[thelist] mysql: monthname results order

Dunstan Orchard dunstan at 1976design.com
Fri Mar 14 09:57:42 CST 2003


Hi guys,

I am using the following query to return all the unique month names from my db 
records:

SELECT DISTINCT MONTHNAME(date) AS month FROM date WHERE (date <> '0000-00-
00') ORDER BY month ASC

At the moment that returns the months in alphabetical order... how can I 
return them in the correct calender order?

Eg:

Jan
Feb
Aug
Oct
Dec

Can't find anything on the mysql site.

Thanks very much,

- dunstan

---------------------------
Dorset, England
http://www.1976design.com/
http://www.orchard.it/
http://www.maccaws.org/


More information about the thelist mailing list