ORA-00979 not a group by expression
You must put all columns of the SELECT in the GROUP BY or use functions on them which compress the results to a single value (like MIN, MAX or SUM). A simple example to understand why this happens: Imagine you have a database like this: and you run SELECT * FROM table GROUP BY foo. … Read more