The
HAVING clause is used to filter output records.
EQL provides two filtering options:
WHERE and
HAVING.
The
HAVING syntax is as follows:
HAVING <BooleanExpression>
You can use the
HAVING clause with any Boolean expression, such as:
- Numeric and string value
comparison:
{= , <>, <, <=, >, >=}
- Null value evaluation:
<attribute> IS {NULL, NOT NULL}
- Grouping keys of the source
statement:
<attribute list> IN <source statement>
In the following example, the results include only sales representatives
who generated at least $10,000:
Return Reps AS
SELECT SUM(Amount) AS SalesTotal
GROUP BY SalesRep
HAVING SalesTotal > 10000