Showing posts with label SQL-Server 2005. Show all posts
Showing posts with label SQL-Server 2005. Show all posts

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