Possible Duplicate:
MySQL Query GROUP BY day / month / year
I have the following mysql:
SELECT MONTH( FROM_UNIXTIME( `timeStamp` ) ) as month , COUNT( `id` ) as count
FROM `discusComments`
GROUP BY MONTH( FROM_UNIXTIME( `timeStamp` ) )
ORDER BY MONTH( FROM_UNIXTIME( `timeStamp` ) ) ASC
LIMIT 15
It gets the amount of entries made per month in the past 15 months. I was wondering WHY it only displayed the past 12 months ... then I realised the count was an aggregate of all years and not unique per month year. So the value for december could be 2012 and 2011 together.
I donÄt want this. I want to get the past 15 months and the amount of entries made for UNIQUE month year, e.g. december 2012, november 2012 etc.