Jack Man Jack Man - 2 months ago 5
MySQL Question

Count by months in MySQL database?

How do you count the total number of entries by month?

id, date

01, 2010-09-28
02, 2010-03-28
03, 2010-09-28
04, 2010-03-28


For example. How could you pick only dates from September and have them count as an output of
2
?

Edit: Edited the dates to put them in the right format.

Answer
select  month(date) , count(*)
from yourtable
group by month(date)
Comments