Friday, October 23, 2009

How to find nth highest salary from Employee table in SQL Server?

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

Share This!


No comments:

Powered By Blogger · Designed By Seo Blogger Templates