< CODE GALLERY />
Tuesday, April 20, 2010
TOP Nth SALARY IN SQLSERVER2005
Top Second Salary :-
select top 1 salary from employee where salary in (select top 2 salary from employee order by salary desc ) order by salary
Top Third Salary :-
select top 1 salary from employee where salary in (select top 3 salary from employee order by salary desc ) order by salary
Just change the value in Inner Query(2,3,4.........)
1 comment:
varun
April 20, 2010 at 11:27 PM
gud lage raho
Reply
Delete
Replies
Reply
Add comment
Load more...
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
gud lage raho
ReplyDelete