To find out the Nth max sal in oracle i\'m using below query
SELECT DISTINCE sal FROM emp a WHERE ( SELECT COUNT(DISTINCE sal) FROM emp b
SELECT sal FROM ( SELECT empno, deptno, sal, dense_rank( ) over ( partition by deptno order by sal desc) NRANK FROM emp ) WHERE NRANK = 4