Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

not a group by expression

MagnetoApr 28 2017 — edited Apr 28 2017

Team

The following query is behaving strangely, when I run the whole query it runs without any error.

But the inner query is failing with "not a group by expression", which is obvious since I deliberately removed emp_id from the group by clause.

I wonder how the whole query is working fine , when the inner query fails . Appreciate your insights

select dept,location,c from (

select emp_id,dept,location,count(*) c

from emp_dept

group by dept,location

)

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 26 2017
Added on Apr 28 2017
12 comments
631 views