SQL Having

What
SQL having clause is used in conjunction with SQL Group By in order to filter grouping fileds.

Format
SELECT [DISTINCT] target-list FROM relation-list WHERE qualification GROUP BY grouping-list HAVING group-qualification

Example
SELECT s.rating, AVG(s.age) FROM Sailors s GROUP BY s.rating HAVING AVG(s.age) > 18 NOTE: The having clause must operate on terms in the SELECT clause. The where clause is not limited as such.