• + 1 comment

    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 , Lead_Manager LM , Senior_Manager SM , Manager M ,Employee E

    WHERE C.company_code = LM.company_code AND LM.company_code = SM.company_code AND SM.company_code = M.company_code AND M.company_code = E.company_code

    GROUP BY C.company_code , C.FOUNDER ORDER BY C.company_code;