Untitled

 avatar
unknown
plain_text
4 years ago
472 B
4
Indexable
SELECT c.company_code, c.founder,
(SELECT count(DISTINCT lead_manager_code) FROM Lead_Manager l where l.company_code = c.company_code),
(SELECT count(DISTINCT senior_manager_code) FROM Senior_Manager s where s.company_code = c.company_code),
(SELECT count(DISTINCT manager_code) FROM Manager m where m.company_code = c.company_code),
(SELECT count(DISTINCT employee_code) FROM Employee e where e.company_code = c.company_code)
FROM Company c
ORDER by c.company_code;
Editor is loading...