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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Select Top 10 salary

Author  Topic 

lymni22
Starting Member

3 Posts

Posted - 2004-08-27 : 05:10:41
How to select top 10 salary from the salary table?
without using top10 command
use inner query
thanks in advance


Lymni

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-08-27 : 05:46:09
declare @n int
set @n = 10 -- top 10th salary
Select *
From Employee E1
Where (@n-1) = (Select Count(Distinct(E2.Salary)) From Employee E2 Where E2.Salary > E1.Salary)


Go with the flow & have fun! Else fight the flow :)
Go to Top of Page
   

- Advertisement -