PDA

View Full Version : MySQL "ORDER BY" Query


Awjvail
12-06-2007, 11:39 AM
SELECT title, pagecount, createdat, userfriendlyname FROM $WT_DB_TemplateTable
WHERE category = 7
ORDER BY createdat DESC

Right now, my output is in order of creation (fairly sure it is backwards too), however I would like to change "ORDER BY createdat" to make it so that it orders it in alphabetical order.

How would I do this?

WhaLberg
12-06-2007, 11:43 AM
ORDER BY title.

Awjvail
12-06-2007, 11:54 AM
Thanks.

Now, how would I reverse the order of them? right now they're going from Z to A.

WhaLberg
12-06-2007, 11:55 AM
Sorry. :)

ORDER BY title ASC

Awjvail
12-06-2007, 11:56 AM
Perfect.

Thanks so much.