Using Sub query
Option Query 1
SELECT MAX(salary) FROM emp WHERE salary NOT IN
(SELECT MAX(salary) FROM emp)
Option Query 2
SELECT MAX(salary) FROM emp WHERE salary <(SELECT MAX(salary) FROM emp)
Option Query 3
SELECT MIN (salary) FROM emp WHERE salary in (SELECT TOP 2 (salary) FROM emp ORDER BY salary DESC)
Option Query 1
SELECT MAX(salary) FROM emp WHERE salary NOT IN
(SELECT MAX(salary) FROM emp)
Option Query 2
SELECT MAX(salary) FROM emp WHERE salary <(SELECT MAX(salary) FROM emp)
Option Query 3
SELECT MIN (salary) FROM emp WHERE salary in (SELECT TOP 2 (salary) FROM emp ORDER BY salary DESC)
No comments:
Post a Comment