• + 0 comments

    Select c.company_code, c.founder,count(distinct lm.lead_manager_code),count(distinct sm.senior_manager_code),count(distinct m.manager_code),count(distinct e.employee_code) from Company c join employee e ON e.company_code = c.company_code join Manager m ON m.manager_code = e.manager_code join senior_manager sm ON sm.senior_manager_code = m.senior_manager_code join Lead_manager lm ON lm.lead_manager_code = e.lead_manager_code GROUP BY c.company_code, c.founder ORDER BY c.company_code\