Posts tagged nth Maximum
Find out the N’th maxium salary?
12 years ago
by Solomon
in SQL Server
Ans: find the 5th maxium salary:
1: SELECT TOP 1 * FROM tblEmployee WHERE E_Salary NOT IN
2: (SELECT DISTINCT TOP 4 E_Salary FROM tblEmployee ORDER BY E_Salary DESC)
3: ORDER BY E_Salary DESC