SELECT *
FROM (SELECT salary, first_name
FROM employees
ORDER BY salary desc)
WHERE rownum <= 3;
select ename,sal
from (select ename,sal from emp order by sal desc) where rownum<=5;
second highest salary with out using max() function :
----------------------------------------------------
SELECT empno,salary FROM
SELECT empno,salary, ROW_NUMBER() OVER(ORDER BY SALARY DESC) rn FROM emp)
WHERE rn = 2
/
SELECT empno,salary from
SELECT empno,salary,rownum rn from emp order by salary desc)
WHERE rn = 2
select salary from empsal
where rownum<2
order by salary desc