HAVING clause 

The HAVING clause specifies the properties of a group.

Syntax

<having clause> ::= HAVING <search condition>

search condition

Explanation

Each expression in the SEARCH condition that does not occur in the argument of a set function (set function spec) must identify a grouping column.

If the having clause is used without a GROUP clause, the result table built so far is regarded as a group.

The search condition is applied to each group in the result table. The result of the HAVING clause is a table that only contains those groups for which the search condition is true.