ORA – 00934: Group function is not allowed here

 Error:

ORA – 00934: Group function is not allowed here


  1. SELECT first_name, last_name count(*)

    FROM employees

    WHERE Count(*) > 1

    GROUP BY last_name;


The above query causes error:

Query result:

  ORA – 00934: GROUP FUNCTION IS NOT ALLOWED HERE

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

Solution:

  v Instead of where clause, we should use HAVING CLAUSE For filtering.

  v Because SQL does not allowed to use Aggregate function in where clause.

    The Query is,


  1. SELECT first_name, last_name count(*)

    FROM employees

    GROUP BY last_name

    HAVING Count(*) > 1;


 

 

 

 

 

Share:

No comments:

Post a Comment

Popular Posts

Search This Blog

Powered by Blogger.

Blog Archive

Service Support

Need our help to Learn or Post New Concepts Contact me

Blog Archive

Recent Posts

Service Support

Need our help to Learn or Post New Concepts Contact me