There are two tables:
- employeee(emp_id,emp_name,salary,dept_id) and,
- department(dept_id,dept_name).
The query is to find the name of department with maximum number of employees. The query I came up with is this
select dept_name from department
where dept_id = (select dept_id from (select dept_id,count(dept_id) numbers
from employee group by dept_id)
where numbers = max(numbers));
The error displayed is this
ORA-00934: group function is not allowed here
Please throw some light here I have been trying this for more than two days.