207502
user_0537875676
mysql
4 years ago
371 B
8
Indexable
SELECT EMPLOYEE.company_code, COMPANY.founder, COUNT(DISTINCT EMPLOYEE.lead_manager_code), COUNT(DISTINCT EMPLOYEE.senior_manager_code), COUNT(DISTINCT EMPLOYEE.manager_code),COUNT(DISTINCT EMPLOYEE.employee_code) FROM EMPLOYEE JOIN COMPANY ON EMPLOYEE.company_code = COMPANY.company_code GROUP BY EMPLOYEE.company_code, COMPANY.founder ORDER BY EMPLOYEE.company_code;
Editor is loading...