PDA

View Full Version : Order results in SQL query


cinq
03-06-2005, 08:08 AM
Is there a way to ORDER BY 2 different parameters at one go ?

Kinda of like


ORDER BY date desc AND postcounts desc


?
Not sure if this makes sense :D

Oblivion Knight
03-06-2005, 08:28 AM
ORDER BY date DESC, postcounts DESCThat should do the trick for you.. :)

cinq
03-06-2005, 08:34 AM
Thanks OK ! :D

WhSox21
03-07-2005, 04:23 AM
If I'm not mistaken you can even do this:
ORDER BY date, postcounts DESC

By the way, hopefully you're not using date as a column in your table :surprised:, that could cause problems unless you use the ` around the column name like this: `date`. I've just found it easier to not use those keywords.