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.
Author |
Topic |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-07-18 : 08:04:49
|
sheel writes "if u have a table that contain the datail of empolyees.how can u find out the name of employee who's salary is second highest salary .please solve my problemthank u" |
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2005-07-18 : 08:54:21
|
Sounds like homework!C'mon....put some effort into it yourself! |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
chetancool
Starting Member
34 Posts |
Posted - 2005-07-18 : 09:42:37
|
HI..Or u can try this query (taken only from the link provided by madhivanan)Select * From Emp E1 Where (2-1)= (Select Count(Distinct(E2.Salary)) From Emp E2 Where E2.Salary > E1.Salary)Here 2-1 means u want to know detail of second highest salaried person. |
|
|
|
|
|