标签:RKE strong pre product 工资 not cin varchar tab
1、题目描述:
输入描述:
无
输出描述:
dept_no | dept_name | sum |
---|---|---|
d001 | Marketing | 24 |
d002 | Finance | 14 |
d003 | Human Resources | 13 |
d004 | Production | 24 |
d005 | Development | 25 |
d006 | Quality Management | 25 |
2、代码:三表关联查询一下即可,分组然后统计每组的个数。
select dm.dept_no,dm.dept_name,count(1) as sum from salaries s join dept_emp de on s.emp_no=de.emp_no join departments dm on de.dept_no=dm.dept_no group by dm.dept_no;
标签:RKE strong pre product 工资 not cin varchar tab
原文地址:https://www.cnblogs.com/guoyu1/p/12244770.html