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
)