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

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

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
全部评论

相关推荐

LZHR:老哥你从投递简历测评完到一面中间隔了多久呀,我这边已经过了五天了仍显示简历筛选中是不是就是挂了
腾讯求职进展汇总
点赞 评论 收藏
分享
评论
2
收藏
分享

创作者周榜

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