В качестве альтернативы вы можете использовать аналитическую функцию max(count(*)) over (order by ...)
с опцией счетчик по убыванию :
with emp( empno,ename,deptno ) as
(
select 7839,'KING',10 from dual union all
select 7698,'BLAKE',30 from dual union all
select 7782,'CLARK',10 from dual union all
select 7566,'JONES',20 from dual union all
select 7788,'SCOTT',20 from dual union all
select 7902,'FORD',20 from dual union all
select 7369,'SMITH',20 from dual union all
select 7499,'ALLEN',30 from dual union all
select 7521,'WARD',30 from dual union all
select 7654,'MARTIN',30 from dual union all
select 7844,'TURNER',30 from dual union all
select 7876,'ADAMS',20 from dual union all
select 7900,'JAMES',30 from dual union all
select 7934,'MILLER',10 from dual
)
select deptno, no_of_emp
from
(
select deptno, count(*) as no_of_emp,
max(count(*)) over (order by count(*) desc) as max_populated
from emp
group by deptno
order by no_of_emp
)
where max_populated = no_of_emp;
DEPTNO NO_OF_EMP
------ ---------
30 6
Rextester Demo