Mysql – date change in sql

MySQL

hi I have a date which is 2009-06-02 00:00:00.000 and i want to only group by month ..

how can change it ?!

Best Answer

You may want to group by month, but have data that spans more than one year. In that case, I would do:

group by Year(MyDate), Month(MyDate)