Having Clause to Filter Groups
The Having clause allows you to filter the rows in the query results based on aggregate caculations when the query includes a Group By clause. The example shown here returns rows for each grouped stock symbol only if the average open price is greater than 100:
You can use the same comparisons in Having clauses as you can in Where clauses.