RE: query
Posted in 1999
SELECT SUM(employee_nr) empl_sum, department_code FROM empl_tbl GROUP BY department_code INTO TEMP sum_tbl; SELECT SUM (empl_sum), manager_code FROM mgr_tbl m, sum_tbl s WHERE m.department_code =3D s.department_code GROUP BY manager_code ORDER BY 1=20 First row will be the manager with the least number of employees . . .. = . -----Original Message----- From: Henk J. Sanders [SMTP:hjs@worldonline.nl] Sent: Thursday, May 13, 1999 8:27 AM To: informix-list@iiug.org Subject: query Hi folks. Probably a very simple query but I cann=B4t get the point. One tabel contains: - department_code - manager_code A manager can have MORE departments. The other table contains: - employee_nr - department_code Question: which manager controls the least nr. of employee=B4s?. Any idea. Many thanks.