#2nd Most highest salary using dense_rank() SELECT sal FROM (SELECT dense_rank() over(ORDER BY sal DESC) AS R, sal FROM emp) employee WHERE R = 2;