HAVING - used with the GROUP BY clause to filter out group rows that do not satisfy a specified condition (like WHERE but for GROUP BY)
- having, like where but for groups
SELECT col1, SUM(col2)
FROM table
GROUP BY col1
HAVING condition — HAVING example
SELECT customer_id, SUM(amount)
FROM table
GROUP BY customer_id
HAVING SUM(amount) > 200
will only returns customer groups with an amount sum > 200