Hello, I have a query that checks a tables and groups all entries from a user and counts those entries
SELECT username,
count(userid)
FROM orders
GROUP BY userid
This returns a list of username's and how many orders they have submitted
username count(userid)
------------------------
test 1
test2 1
test3 3
test4 3
test4 3
test4 3
What i want the query to do is count how many users have X orders and return that number.
So from the above results users that have 1 order should be 2 and users that have 3 orders should be 4. So on and so forth can this be done?