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 - 2006-04-11 : 09:25:22
|
| shilpa writes "I have a table created in my sql server.the table contains the emp details withe salaries.I want to write a query which displays the emp details having third highest salary or fourth highest salary." |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-04-11 : 09:34:48
|
[code]Select min(sal) from( select top 3 sal from yourTable order by sal DESC) T[/code]Why is this question mostly asked in Interviews? MadhivananFailing to plan is Planning to fail |
 |
|
|
twhelan1
Yak Posting Veteran
71 Posts |
Posted - 2006-04-11 : 11:07:22
|
Because the employees having the third and fourth highest salaries are the ones being replaced by someone less qualified who asks for less money? ~Travis |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-04-12 : 05:44:45
|
quote: Originally posted by twhelan1 Because the employees having the third and fourth highest salaries are the ones being replaced by someone less qualified who asks for less money? ~Travis
MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|