User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 423,567 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,636 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums

ORDER BY Multiple Columns

Join Date: Dec 2007
Posts: 355
Reputation: OmniX is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
OmniX's Avatar
OmniX OmniX is offline Offline
Posting Whiz

ORDER BY Multiple Columns

  #1  
May 16th, 2008
I have multiple columns I wish to order by.

I have columns:
# # # # (1, 2, 3, 4)
A 0 0 0 0
B 1 0 1 3
C 1 0 2 3

I want to ORDER BY 4, 3, 2, 1.

Syntax I am using:
"SELECT * FROM table ORDER BY 4, 3, 2, 1"
Note: I am not sure wether to use ASC or DESC - or even if I have to use it.

Thanks, Regards X
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 6:50 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC