I have following query which groups and counts entries for each day :
SELECT DISTINCT `year`, `month`, `day`, count(entry_id) as 'posts'
FROM (`exp_channel_titles`)
WHERE `status` = 'open'
GROUP BY `year`, `month`, `day`
ORDER BY `entry_date` desc
it works fine however it selects from all categories but I want to limit to one or more category.
for people who are not familiar with EE database, here is few example from tables which we may need
exp_channel_titles:
entry_id year month day
1 2011 11 5
2 2011 11 6
3 2011 11 7
exp_categories:
cat_id cat_name
1 sport
2 computer
3 car
exp_category_posts: which connects entries to categories
entry_id cat_id
1 2
1 2
2 1
3 3
1 Answer