Jack Man Jack Man - 8 months ago 49
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

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

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