Jack Man Jack Man - 1 year ago 94
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.

Answer Source
select  month(date) , count(*)
from yourtable
group by month(date)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download