GROUP BY clauses must include all columns specified in the SELECT clause

The ANSI SQL standard requires all columns specified in the SELECT clause which are not aggregates to be included in the GROUP BY clause. DBMS which follow the standard, such as Oracle, throw an error if this is not the case.