sql query to find 3rd highest salary code example
Example 1: nth highest salary
SELECT salary FROM Employee ORDER BY salary DESC LIMIT N-1, 1
Example 2: n highest salary in sql
SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP N salary
FROM #Employee
ORDER BY salary DESC
) AS temp
ORDER BY salary