How to get 1st, 2nd, 3rd, 4th, nth topmost salary from an Employee table
The following solution is for getting 5th highest salary from Employee table ,SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP 5 salary
FROM employee
ORDER BY salary DESC) a
ORDER BY salaryIf you want to retrieve a nth Maximum value then use nth value instead of 5 and enjoy!!!!!!!
Cheers
