• When you use an aggregate function, all non-aggregate data must be included in the GROUP BY.

    Greg