I have the following sql statement:
SELECT MODEL, COLOR, SUM(SALES)
FROM SALES
WHERE MODEL='chevy'
GROUP BY MODEL;
When I run this statement, I have an error message saying " "sales.color" must appear in the GROUP BY clause or be used in an aggregate function"
I don't understand why COLOR has to appear in Group by or used in aggregate function.
Thanks.