Online Tutorials & Training Materials | STechies.com
Register Login
Advertisement

How to Display the Manager, Having Maximum Number of Employee?

|| || 2

How to Display the Manager, Having Maximum Number of Employee?
Stechies

Hello Experts,

May I know that how can I display the manager who is having maximum number of employees working under him?

Kindly share your valuable views here,

Thanks in advance.


Comments

  • 16 Oct 2015 2:15 pm Helpful Answer

    SQL> select manager.ename from associate, manager
    where manager.sal> (select avg(sal) from emp where
    associate.mgr=manager.empno);

  • 16 Oct 2015 2:16 pm Helpful Answer

    select mgr,count(empno) as total_employees from emp group by mgr
    having count(empno)=(select max(count(empno))from emp group by mgr);


Advertisement
Advertisement