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 |
|
Sun Foster
Aged Yak Warrior
515 Posts |
Posted - 2005-09-29 : 09:25:34
|
| I want to select top 25 orders which based on desc sorting in Order table (it did not sort). I use code like:SELECT TOP 25 OrderID, OrderDateFROM tblOrder ORDER BY OrderDate DESC;Question: These top 25 are selected after "ORDER BY OrderDate DESC" or select randomly from Order table and then "ORDER BY OrderDate DESC"? |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-09-29 : 09:33:23
|
order by is first then top is applied.Go with the flow & have fun! Else fight the flow |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-09-29 : 09:34:27
|
| Your query is correctAre you using SQL Server2000 or Access?MadhivananFailing to plan is Planning to fail |
 |
|
|
Sun Foster
Aged Yak Warrior
515 Posts |
Posted - 2005-09-29 : 09:48:56
|
| SQL server2000.Thank you. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-09-29 : 09:50:46
|
| Then that query will workPost some sample data and the result you wantMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|