Tuesday, June 8, 2010

Find nth highest salary

Find 1, 2,3 and nth highest salary

select top 1 salary from (
select distinct top n salary from tab order by salary desc ) a
order by salary asc

No comments:

Post a Comment