Alternative to Having and Group By I'm in the DB classes, and I have to understand and show that it is possible to get the results of HAVING and GROUP BY without using themselves. I searched for alternatives for those 2 commands, but I didn't understand anything. 

Can someone give me examples?
Assuming a query like:

SELECT category, COUNT(*)
FROM T
GROUP BY category
HAVING COUNT(*) &gt; 3


You can mimic that with:

SELECT category, cnt
FROM (
    SELECT x.category
       , ( SELECT COUNT(*) from T where T.category = x.category ) as cnt
    FROM (
        SELECT distinct category from T -- GROUP BY
    ) as x
) as y
WHERE y.cnt &gt; 3 -- HAVING