What is the difference between a HAVING CLAUSE and a WHERE CLAUSE?
HAVING CLAUSE
- HAVING CLAUSE is used only with SELECT statement.
- It is normally used in a GROUP BY clause in a query.
- If GROUP BY isn't used, HAVING works like a WHERE clause.
WHERE Clause
- It is applied to every row before they become a part of GROUP BY function in a query.