select a.dept, b.num from vzdbm a,(
select count(employeeid) num,dept from s_tempemployeeinfo_386 e,vzdbm d
where e.ordernum is not null and e.departmentid(+) =d.dept
group by d.dept ) b where a.dept = b.dept(+) order by a.dept
统计
本文提供了一个SQL查询案例,展示了如何从多个表中联接并按部门汇总员工数量。具体包括使用子查询、表联接以及分组函数进行数据聚合的方法。

被折叠的 条评论
为什么被折叠?



