📜  获取管理人员和执行人员的数量以及公司代码及其创始人 - 无论代码示例

📅  最后修改于: 2022-03-11 14:54:57.132000             🧑  作者: Mango

代码示例1
select c.company_code, 
    c.founder, 
    count(distinct e.lead_manager_code), 
    count(distinct e.senior_manager_code), 
    count(distinct e.manager_code), 
    count(distinct e.employee_code)
from company c
    inner join employee e on e.company_code = c.company_code
group by c.company_code,c.founder
order by c.company_code;