I'm trying to get count from date for each month.
SELECT COUNT(*) AS cnt, DATE_FORMAT(onBoardDateTime,'%Y-%m-01') AS date
FROM paDatabase
WHERE YEAR(onBoardDateTime) > '2015'
GROUP BY MONTH(onBoardDateTime)
I want also include month with count = 0. So result should be:
Month | cnt
2015-01 | 10
2015-02 | 31
2015-03 | 0
2015-04 | 5
etc..
Thanks