Reputation: 33
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 ?!
Upvotes: 3
Views: 118
Reputation: 171371
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)
Upvotes: 2
Reputation: 125456
use
group by MONTH(record_date)
see this question for more information :
MySQL Query GROUP BY day / month / year
Upvotes: 0