MySQL won't show results as DESC?

I'm simply trying to display the query below in date DESC so 2012 is at the top but for some reason it's displaying ASC?

I have used the same code on another pretty much identical database fine. Any ideas why this isn't working?

SELECT id, YEAR(`eventdate`) AS 'year', MONTH(`eventdate`) AS 'month', COUNT(`id`) AS 'count'  FROM `news` GROUP BY YEAR(`eventdate`), MONTH(`eventdate`) ORDER BY YEAR('eventdate') DESC, MONTH('eventdate') DESC

Open in new window

Screen-shot-2012-04-05-at-13.18..png
Screen-shot-2012-04-05-at-13.22..png
BrighteyesDesignAsked:
Who is Participating?
 
johanntagleConnect With a Mentor Commented:
Can you try ORDER BY 1 DESC, 2 DESC ?  The numbers refer to the columns in the SELECT clause.
0
 
Meir RivkinFull stack Software EngineerCommented:
try run the query without the id, do u get descending results?

SELECT  YEAR(`eventdate`) AS 'year', MONTH(`eventdate`) AS 'month' FROM `news` GROUP BY YEAR(`eventdate`), MONTH(`eventdate`) ORDER BY YEAR('eventdate') DESC, MONTH('eventdate') DESC
0
 
BrighteyesDesignAuthor Commented:
Still the same? very strange.
Screen-shot-2012-04-05-at-14.01..png
0
 
BrighteyesDesignAuthor Commented:
Thanks a million, works perfectly now
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.