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 |
|
goldfish
Starting Member
2 Posts |
Posted - 2004-04-27 : 00:55:25
|
| Write an SQL list the names of the top 5 players and their scores, sorted by score, along with the rank for each playerTable given:PlayerID (int) PlayerName varchar(30) Score (int)1 Bench 20 2 Perez 353 Morgan 354 Concepcion 105 Rose 186 Foster 447 Geronimo 18And this is the expected result:RankNo PlayerName Score1 Foster 442 Perez 352 Morgan 354 Bench 205 Rose 185 Geronimo 18I don't know how to create the RankNo column which will be increased in such a behavior. Anybody knows? Please help... Goldfish |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2004-04-27 : 01:37:09
|
http://www.sqlteam.com/item.asp?ItemID=6398A search for "Rank" on the front page of SQLTeam finds this answer Damian |
 |
|
|
goldfish
Starting Member
2 Posts |
Posted - 2004-04-27 : 02:20:54
|
| Thanks so much! DamianGoldfish |
 |
|
|
|
|
|