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-07-10 : 09:11:41
|
| Diwakar writes "dept emp sal d1 1 100 d2 2 400 d3 3 500 d1 4 600 d2 6 200 d3 7 300 d2 8 700 d1 9 500 d3 10 200 d1 11 300 d2 12 900 d3 13 800 i want second highest salary from each department...Can I have a query for the same?I am using Windows XP, SQL server 2005" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2006-07-10 : 09:45:04
|
| I'll give you a clue: With SQL 2005, the key is to use the new RANK() and PARTITION functions.- Jeff |
 |
|
|
|
|
|