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 |
|
robert323
Starting Member
3 Posts |
Posted - 2006-07-24 : 16:41:41
|
| Hello all, I'm verry new to SQL server, and find myself trying to sort a table ascendingly be several columns. For instance:SELECT * FROM Sort ODER BY start_year AND start_month ASCI've tried to run this, but it simply does not work.Is there a simple way to do something like this?Any help is greatly appreciated! Thanks so much-Robert |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-07-24 : 16:45:11
|
"ODER BY"?You might try it like this:ORDER BY start_year, start_month CODO ERGO SUM |
 |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2006-07-25 : 03:07:05
|
| Just a small addition...you can sort the different columns in different directions:SELECT * FROM Sort ORDER BY start_year DESC, start_month ASC--Lumbago"Real programmers don't document, if it was hard to write it should be hard to understand" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|