--find the 3rd and nth salary select * from( select name, salary, dense_rank() over(order by salary desc)r from tblemployee) as salarySort where r in (2,3); -- find the salary based on the r value, sort by dense rank
--find the 3rd and nth salary select * from( select name, salary, dense_rank() over(order by salary desc)r from tblemployee) as salarySort where r in (2,3); -- find the salary based on the r value, sort by dense rank