There are number of examples to get second highest salary from EMP table.
example-select sal from(select sal from
(select distinct sal from emp order by sal desc)
where rownum<=2 order by sal asc)
where rownum=1;
example- SELECT MAX(SAL) FROM EMP WHERE SAL NOT IN (SELECT MAX(SAL) FROM EMP)
where EMP is table name,SAL is salary colum.

Comments