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
 SQL Server Development (2000)
 second largest

Author  Topic 

rajeshskpm
Starting Member

10 Posts

Posted - 2009-02-17 : 01:18:16
Hi,

in one table called employee has a field called salary.i want to find second largest salry? please give the query


rajesh

Nageswar9
Aged Yak Warrior

600 Posts

Posted - 2009-02-17 : 01:21:09
select max(salary) from urtable where salary < ( select max(salary) from urtable)
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-02-17 : 01:34:42
http://sqlblogcasts.com/blogs/madhivanan/archive/2007/08/27/find-nth-maximum-value.aspx

Madhivanan

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

- Advertisement -