HAVING
HAVING Clause
The SQL HAVING clause is used in combination with the GROUP BY clause or an aggregate function.
It restricts the returned rows to only those where the HAVING condition is true.
HAVING is used to filter records that work on summarised GROUP BY results.
The WHERE clause cannot be used with aggregate functions. The HAVING clause is applied to grouped records, but WHERE is applied to individual records.
HAVING can also be used in combination with WHERE and ORDER BY clauses, for example:
The WHERE clause is used to restrict the rows that are returned from the tables(s).
The ORDER BY clause is used to sequence the rows in the answer table.
The HAVING clause is used to filter summarised and/or aggregated data or grouped data.
So the new order for the clauses within an SQL Query is now: