With the table:
id date_from date_to
---------------------------
1 2010-01-01 2010-03-01
2 2010-02-07 2010-05-01
3 2010-07-05 2010-07-10
I am trying to return a result which has one row for each month of the year that lets me know how many rows were active in that period.
So for the above I would want the result
2010-01-01 1
2010-02-01 2
2010-03-01 2
2010-04-01 1
2010-05-01 1
2010-06-01 0
2010-07-01 1
2010-08-01 0
2010-09-01 0
etc...
I've tried grouping my MONTH(date_from) , but that doesn't return the rows with no results