You would usually specify conditions in WHERE clause like following:
WHERE some_condition
But WHERE clause imposes conditions on columns present in the tables and cannot be used to impose restrictions on groups of records created by GROUP BY clause.
HAVING clause is used to places conditions on groups created by GROUP BY clause.
Some properties of HAVING clause:
- HAVING requires that a GROUP BY clause is present in the query
- WHERE and HAVING clauses can be both present in the same query
- HAVING clause applies to summarized group records, while WHERE clause applies to individual records
Ввійдіть щоб вподобати
Ввійдіть щоб прокоментувати