Site icon IT Tutorial

ORA-00934: group function is not allowed here

I got ” ORA-00934: group function is not allowed here ”  error in Oracle database.

 

ORA-00934: group function is not allowed here

 

Details of error are as follows.

SELECT name, surname count(*) FROM employee WHERE Count(*) > 1 GROUP BY surname;

ORA – 00934: GROUP FUNCTION IS NOT ALLOWED HERE

00964, 00000 – “group function is not allowed here”




 

 

GROUP FUNCTION IS NOT ALLOWED HERE

This ORA-00934 error is related to the group function which is not allowed.

You need to use HAVING CLAUSE For filtering if you use Aggregate function ( AVG, COUNT, MAX, MIN, SUM, STDDEV, or VARIANCE, ) in where clause.

 

To solve this error, use HAVING clause instead of where like following.

 

SELECT name, surname count(*) FROM employee GROUP BY surname HAVING Count(*) > 1;

 

 

 

 

Do you want to learn Oracle Database for Beginners, then read the following articles.

Oracle Tutorial | Oracle Database Tutorials for Beginners ( Junior Oracle DBA )

 

Exit mobile version