SELECT * FROM
(SELECT SALARY, ROWNUM ROWNO FROM
(SELECT SALARY FROM EMP_DETAILS ORDER BY SALARY DESC)
WHERE U.ROWNO = 3;
The inner query "(SELECT SAL FROM EMP_DETAILS ORDER BY SAL DESC)" gives you the list of salaries in the required order.
The next query "(SELECT SAL, ROWNUM ROWNO FROM
Gives you the salary, the rownum in the correct order and the query alias U to be used in the outer query. The rownum must be aliased to (in this case to rowno) so it can be referenced in the outer query.
The outer query "SELECT * FROM
(... (...) ) U
WHERE U.ROWNO = 3;"
pulls out the 3rd row, ie the third highest salary.