As part of the Structured Query Language (SQL), when a user wishes to perform an aggregate function (SUM, AVG, COUNT, etc) on one or more fields in a SELECT query, the remaining fields in the SELECT clause must be in a GROUP BY clause. The fields that will be placed in a GROUP BY clause tell SQL how to group the data that is being aggregated. The error message associated with your question essentially say that if you are going to have even one aggregate function in your query, then ALL of the fields in the SELECT clause must either have an aggregate function applied or you have to place them in the GROUP BY clause.
For example, if I have 3 fields in a SELECT query (Region, State, and Sales), and I want to know the total Sales, I have to include both of the other fields in the GROUP BY. This will tell me the total Sales by Region and State.
However, If I only want the sales by Region, I have to remove the State field from the SELECT clause because the results would not make sense with the state's listed.
But if you have two measures in your select query such as Sales and Units, and you want to SUM the sales, then you will likely also need to apply an aggregate to the Units field.
Notice that in the above code, because you have at least one aggregate function, every field in the SELECT list is either in the GROUP BY clause or has an aggregate function applied to it.