HAVING - Retrieval with GROUP BY in Teradata

HAVING will be used with GROUP BY clause to validate the result produced by the group by clause.

Code example:
SELECT class, AVG(price)
FROM tbl_list
GROUP BY class
HAVING AVG(price)>=3000;


Note:
Group functions cannot be used in WHERE clause so that HAVING is useful.

A SQL can have both WHERE and HAVING clauses.
WHERE - filters data before grouping
HAVING - filters data after grouping