ORA-00979 - Not a group by expression

All columns of your SELECT must be listed in the GROUP BY expression. Alternately you can use functions MIN() or MAX() which compress results.