ORA-00934: group function is not allowed here
Cause: You tried to execute a SQL statement that included one of the SQL group functions, ie: SQL MIN(), MAX(), SUM(), COUNT(), AVG(), STDDEV(), or VARIANCE() in either the SQL WHERE clause or the SQL GROUP BY clause. This is not allowed.
Action: Remove the group function from the WHERE or GROUP BY clause. The desired result may be achieved by including the function in a subquery or SQL HAVING clause.
Error Type: ORA