You are here:Home » tsql » Query to Retrieve the Nth Maximum Value

Query to Retrieve the Nth Maximum Value

SELECT *
FROM Employee E1
WHERE (N-1) = (
SELECT COUNT(DISTINCT(E2.Salary))
FROM Employee E2
WHERE E2.Salary > E1.Salary)