select
5th MAX Salary
select max(SALARY) from EMP A where 5 ( select count(distinct(SALARY)) From EMP B where B.ID> A.ID)
SELECT empid empname salary RANK() OVER (ORDER BY salary DESC) AS Rank_SalaryFROM empQUALIFY Rank_Salary< 3;
where n is the nth highest salary you want.