We are running reports and need a query - we're using playa and I want to get the total number of child_entries where channel_id = 16 and where the 'parent_field_id' = 68.
My current query is:
SELECT exp_channel_titles.entry_id, exp_channel_titles.title, count(exp_playa_relationships.child_entry_id) AS entry_count
FROM exp_channel_titles LEFT JOIN exp_playa_relationships ON exp_channel_titles.entry_id = exp_playa_relationships.child_entry_id
WHERE exp_playa_relationships.parent_field_id = 68 AND exp_channel_titles.channel_id=16
What I expected to see was:
- Event Title - Entry ID 1218 - total articles: 788
- Event Title - Entry ID 2866 - total articles: 605
What I am getting is:
- Event Title - Entry ID - total articles: 1393
Any thoughs how this would be achieve and what I missed?