HAVING is basically a Post-Processing of the SQL-Result. Therefor HAVING uses the newly defined column names, not the original field names:
SELECT ZipCode, count(*) AS HowMany FROM Adresses GROUP BY 1 WHERE State = "TX" HAVING HowMany > 1000
-----Ursprüngliche Nachricht----- Von: ProFox profox-bounces@leafe.com Im Auftrag von Ricardo Araoz Gesendet: Freitag, 30. März 2018 22:40 An: profox@leafe.com Betreff: Re: Unexpected results from a group by clause
Yup, it's like a "where" but it acts kind of after the grouping so you can use aggregate functions to limit the output.