In a grouping SELECT, you must list every nonaggregate column in the GROUP BY clause to ensure that a well-defined value exists for each selected column in each grouped row. A column contains either a single aggregate value or a value unique to that group. If a selected column were neither an aggregate nor in the list, two or more values for that column might possibly exist in some group, and the database server could not choose which value to display. Revise the query to include either the column name or its positional number in the clause.