Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 query

Author  Topic 

praveenkrr
Starting Member

1 Post

Posted - 2006-06-15 : 01:04:05
how to find the 10th highest emp sal from a company

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-06-15 : 01:36:35
something like...
select top 1 from (select top 10 order by desc) order by asc

--------------------
keeping it simple...
Go to Top of Page

sachinsamuel
Constraint Violating Yak Guru

383 Posts

Posted - 2006-06-15 : 02:14:33
Nice article to find nth maximum record.

http://www.sqlteam.com/item.asp?ItemID=16134

Hope it helps.

Regards
Sachin

Don't sit back because of failure. It will come back to check if you still available. -- Binu
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-06-15 : 02:41:46
[code]Select min(sal) from
(
Select top 10 sal from emp order by sal DESC
) T[/code]

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -