SELECT c.count, count(*) FROM (SELECT count(*) as count FROM category GROUP BY id) as c GROUP BY c.count