The Tech Pursuit
The Dev Shelf
Pages
Home
Interview Questions
About Me
June 9, 2011
Find Nth highest Salary from table in SQL Server
SELECT * FROM TblSal S1
WHERE
(N-1) = (SELECT COUNT(DISTINCT(S2.Salary)) FROM TblSal S2 WHERE S2.Salary > S1.Salary)
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment