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 <[email protected]> Im Auftrag von Ricardo Araoz Gesendet: Freitag, 30. März 2018 22:40 An: [email protected] 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. _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

