I need some help with this code of mine. I want to retrieve total counts of registered members for every event they registered in. I hope someone can help me with this. Thank you in advance.
Here's my code:
SELECT *, COUNT(*) as TotalAttendee
from activities
join projectcode on activities.projects_id = projectcode.projects_id
join participants on participants.act_id = activities.id
where activities.projects_id='1001'
order by YEAR(activities.activity_date) desc
This is should be the output
+------------+----------------+
|Event Title |Total Attendees |
+------------+----------------+
|Event 1 | 110 |
+------------+----------------+
|Event 2 | 90 |
+------------+----------------+