-1

Can I group by month in a MySQL DATETIME field or do I have to create separate fields with just the month and the year?

AdamMc331
  • 16,492
  • 10
  • 71
  • 133
  • possible duplicate of [MySQL Query GROUP BY day / month / year](http://stackoverflow.com/questions/508791/mysql-query-group-by-day-month-year) – AdamMc331 Jun 29 '15 at 19:07

1 Answers1

0

You can like this

select month(datetime_field)
from your_table
group by month(datetime_field)
juergen d
  • 201,996
  • 37
  • 293
  • 362