I’ve got a table with tutorials (tutorial_id,user_id,tutorial_date) and I’m tasked with finding out how many users did a particular number of tutorials.
So, if there were 5 users who did 6 tutorials, and 3 users who did 2 tutorials, I’d want the following output:
Tutorial_Count (unique) Number of Students With this Tutorial Count
6 5
2 3
I can get the distinct counts (first column):
SELECT DISTINCT COUNT(user_id) from tutorials group by user_id
But I don’t know how to count the number of users who fit into those count brackets.
Untested, but try this: