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 |
|
aikman
Starting Member
22 Posts |
Posted - 2008-07-07 : 10:25:25
|
| Hii need to do a query to get top 5 sales from a table. table looks like thisid pers_id salery bonus totalsal sal_period1 1 10000 1017 11017 2005-20062 2 10000 978 10978 2005-20063 5 10000 972 10972 2005-20064 6 10000 1048 11048 2005-20065 7 10000 1013 11013 2005-20066 10 15000 1005 16005 2005-20067 13 15000 978 15978 2005-2006i need to do a query to get top 5 sales persons from bonus columThanks for help |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-07 : 10:27:00
|
[code]select top 5 *from tableorder by totsal desc[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|