【发布时间】:2020-05-29 14:38:49
【问题描述】:
编写查询以按部门名称显示具有最大员工数量顺序的部门名称。
这是我的问题的架构:
我试过了:
select d.department_name
from department d
inner join staff s on d.department_id=s.department_id
group by d.department_name
having count(s.staff_id) >= all
( select count(s.staff_id) as cnt
from department d
inner join staff s on d.department_id=s.department_id
group by department_name )
order by d.department_name desc;
我能够通过一个导致“SE”部门的测试用例,但我无法通过另一个测试用例。我不知道第二个测试用例想要什么。我不确定我在上面的代码中做错了什么。
【问题讨论】:
-
您能否包含创建架构、填充测试数据、测试用例的细节以及测试结果所需的命令?