select empno,ename,no_of_rep,name_of_rep
from emp,
(select mgr,listagg(ename,',') name_of_rep,
count(*) no_of_rep
from emp
group by mgr) r
where emp.empno=r.mgr(+)
order by empno;
select empno,ename,
(select listagg(ename,',')
from emp where mgr = e.empno) name_of_rep,
(select count(1)
from emp where mgr = e.empno) no_of_rep
from emp e
order by empno;
select m.empno,m.ename,
listagg(e.ename,',') name_of_rep,
count(e.ename) count_of_rep
from emp m, emp e
where m.empno=e.mgr(+)
group by m.empno,m.ename
order by 1