Having Clause

Syntax

HAVING conditional-expression

Description

The Having clause is a restriction on groups and has one or multiple conditions. The Having clause is performed after the GROUP BY clause and restricts the final output. The Having clause compares one column or aggregate expression of the group with another aggregate expression. This function is applied only to the results of a GROUP BY statement.

Do not use a condition that applies to the rows contributing values that are to be processed by the function.