HAVING

HAVING — Is used to filter groups based on conditions involving aggregate functions.

SELECT department, SUM(salary) as total_salary
FROM employees
GROUP BY department
HAVING SUM(salary) > 100000;

It is similar to the WHERE clause, but it applies to groups of rows rather than individual rows.

HAVING — Structure map

Clickable & Draggable!

HAVING — Related pages: