Pages

Thursday 10 January 2013

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)

No comments:

Post a Comment