nth highest salary in sql server

Friday, 5 April 2013

nth highest salary in sql server



SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP n salary
FROM employee
ORDER BY salary DESC) a
ORDER BY salary

No comments:

Post a comment