Difference Between Having and Where clause




HAVING
WHERE
It species a search condition for a group or an aggregate function used in select statement.
It specifies the criteria which individual records must meet to be selected by a query. It can be used without the GROUP By clause.
The HAVING clause selects rows after grouping.
The WHERE clause selects rows before grouping.
The HAVING clause can contain aggregate function.
The WHERE clause cannot contain aggregate function.

No comments:

Post a Comment