DEV Community

Discussion on: SQL Review - GROUP BY Query

Collapse
 
darkain profile image
Vincent Milum Jr

"HAVING is used on aggregate functions in lieu of the WHERE clause."

Not quite. You can have both HAVING and WHERE in the same SQL query, or either of the two for an aggregate query. The difference is that WHERE is applied before the aggregation, and HAVING is applied after.

Collapse
 
jo profile image
Jo

Thanks for clarifying!