Having a table with a column like: mydate DATETIME ...
mydate DATETIME
I have a query such as:
SELECT SUM(foo), mydate FROM a_table GROUP BY a_table.myd
I found that I needed to group by the month and year so neither of the above worked for me. Instead I used date_format
SELECT date FROM blog GROUP BY DATE_FORMAT(date, "%m-%y") ORDER BY YEAR(date) DESC, MONTH(date) DESC