Re: Third largest salary

From: MUSTAFA (anonymous_at_discussions.microsoft.com)
Date: 05/12/04


Date: Tue, 11 May 2004 23:56:22 -0700

THANKS STEVE ITS WORKING !
MUSTAFA
>-----Original Message-----
>-- if you want only one row, even if there are others
with the same salary
>select top 1 * from (
> select top 3 * from Employee
> order by Salary
>) T
>order by Salary desc
>
>-- if you want to include ties:
>select top 1 with ties * from (
> select top 3 with ties * from Employee
> order by Salary
>) T
>order by Salary desc
>
>Steve Kass
>Drew University
>
>mustafa wrote:
>
>>Dear Sir
>>
>>I want to retrive data that will return 3rd largest
salary
>>paid employee from employee table using sql query.
>>
>>thanks
>>
>>
>
>.
>



Relevant Pages