To find highest salary from db we use max in query.
How to get 2nd highest salary from db. can any one suggest the sq query
To find highest salary from db we use max in query.
How to get 2nd highest salary from db. can any one suggest the sq query
This should help:
SELECT max(salary)
FROM mytable
WHERE salary < (
SELECT max(salary) FROM mytable
)
Far to many ways to achieve this.
SELECT Salary
FROM Salarytable
ORDER BY Salary DESC
LIMIT 1,1