HAVING

WHERE filters rows before they're grouped; HAVING filters the groups afterward, by their aggregates. Know which to use, and the order a query's clauses run in.

Updated

Cheat sheet: HAVING
Category
SQL
Level
Journeyman
Tags
having, Query Order of Execution, sql, t-sql, where