fbpx

Write a query to display manager and employees under them?

VijayaTech Labs Blog
Share on facebook
Share on twitter
Share on linkedin
Share on whatsapp

select manager,count(employee),
rtrim(xmlagg(xmlelement(e,employee||’,’)).extract(‘//text()’),’,’) as “Employees under the Manager”
from (select e2.first_name manager,e1.first_name employee
from employee e1,employee e2
where e1.reporting_to=e2.employeeid)
group by manager;

Share this post with your friends

Share on facebook
Share on twitter
Share on linkedin
Share on pinterest
Share on skype
Share on telegram
Share on whatsapp
Share on email

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top