Q- What is the difference between the
Ans- When
WHERE and HAVING clauses?Ans- When
GROUP BY is not used, the WHERE and HAVING clauses are essentially equivalent.
However, when
GROUP BYis used:- The
WHEREclause is used to filter records from a result. The filtering occurs before any groupings are made. - The
HAVINGclause is used to filter values from a group (i.e., to check conditions after aggregation into groups has been performed).
great
ReplyDelete