Table reports : id (int) catid (int) pub_date (datetime)
Table categories : id (int) parent_id (int)
I want to get the report results with count(id) 's and group by catid's parent_id.
For example :
Date Count(parent_id = 1) Count(parent_id = 2) Count(parent_id = 3)
2014-02-24 2 5 8
We should have get the results in only a line per day.
Thanks too much in advance.