题解 | #统计各个部门的工资记录数#

统计各个部门的工资记录数

http://www.nowcoder.com/practice/6a62b6c0a7324350a6d9959fa7c21db3

*将两张小表连接为新表 t,salaries表和新表 t 连接
select t.dept_no,t.dept_name,count(t.dept_name) as sum
from salaries s,(select de.emp_no,de.dept_no,d.dept_name
                 from dept_emp de,departments d
                 where de.dept_no = d.dept_no) as t
where s.emp_no = t.emp_no
group by t.dept_name
order by t.dept_no
全部评论

相关推荐

牛客773130651号:巨佬,简历模板换成上下的,左右的很烦,hr看着不爽。。。科大随便乱杀,建议能保研就保研,不行也得考一下 ,985硕去干算法,比开发强多了。开发许多双非都能搞,学历优势用不上,算法有门槛
点赞 评论 收藏
分享
评论
2
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务