HAVING clause operates exactly as a
WHERE clause, although it operates on the output of a
You can use the same syntax with the
HAVING clause as with the
Expressions used in the GROUP BY clause must contain either an aggregate function (
MAX), or be one of the grouping expressions.