Using the HAVING clause
Last updated: 8/28/2026The HAVING clause is used to filter out the groups that do not satisfy a condition given by an expression.
The HAVING keyword should be followed by an expression that returns a
Boolean:
HAVING expression
It is similar to the Using the WHERE clause, but the HAVING clause is used to filter groups instead of individual objects. It should be used after a GROUP BY or a GROUP AS clause.