tags:

views:

37

answers:

2

I have a mysql table that contains a date field in epoch time format. I need to count how many rows I have for each calendar month of the year. I don't even know where to start. Thanks in advance.

+3  A: 
SELECT  YEAR(FROM_UNIXTIME(mycolumn)) AS yr,
        MONTH(FROM_UNIXTIME(mycolumn)) AS mon,
        COUNT(*)
FROM    mytable
GROUP BY
        yr, mon
Quassnoi
+1  A: 

I'd start with something like this:

select count(1) from table group by month(<your timestamp column>)
david a.