I want LIMIT to group the results to 30, but instead I group all the rows and then limit them to 30 groups. How can I do the opposite?
SELECT *, COUNT(*) AS COUNT FROM `Posts` GROUP By `Category` LIMIT 30
SELECT *, COUNT(*) AS COUNT FROM (SELECT * FROM `Posts` LIMIT 30) t GROUP By `Category`