HAVING
Clause and the WHERE
clause is very similar HAVING
clause support WHERE
clause for all the operators and syntax, but there are a few differences between the two:
WHERE
Clause is used to filter the data row, while theHAVING
clause is mainly used to filter the packet, i.e.HAVING
clause to filter the data packets based on the value of the aggregate values rather than a specific row, primarily used to filter packets.WHERE
Clauses cannot contain aggregate functions,HAVING
and conditions in clauses can contain aggregate functions.HAVING
Clauses are filtered after data grouping,WHERE
clauses are filtered before data grouping.WHERE
Clause excluding lines contained in the packet, can affectHAVING
clause filters out packets based on these values.