WHERE, GROUP BY, and HAVING clauses in a SELECT statement are evaluated in this order: WHERE GROUP BY HAVING