SELECt department_ID, count(employee_id) as '# of Employees' FROM EMPLOYEES WHERe DEPARTMENT_ID IN ( SELECt DEPARTMENT_ID FROM EMPLOYEES GROUP BY DEPARTMENT_ID HAVINg COUNT(*)>5 )AND HIRE_DATE NOT LIKE '%JAN%'group by department_ID;
该查询返回department_id,并且由于我按department_id分组,因此将返回属于每个部门的员工数
输出看起来像这样
Department_Id | # of Employees 1 7 2 6 4 9
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)