gpt4 book ai didi

mysql - 选择员 worker 数最多的部门

转载 作者:行者123 更新时间:2023-11-29 02:56:20 25 4
gpt4 key购买 nike

我有两个表 EMP(id,name,DEPT_id)DEPT(id ,name)。我需要找到最多员工工作的部门。请帮忙。

最佳答案

这将给出员 worker 数最多的部门的部门名称。

Select DEPT_NAME from department where DEPT_ID = (select DEPT_ID from (Select DEPT_ID, count(DEPT_ID) from Employee group by DEPT_ID order by count(DEPT_ID) desc) where rownum = 1);

关于mysql - 选择员 worker 数最多的部门,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30426066/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com