MYSQL:

select d.dept_no,d.dept_name,count(salary) as sum
from departments d join dept_emp de
on d.dept_no=de.dept_no
join salaries s
on de.emp_no=s.emp_no
group by d.dept_no
order by dept_no;

 

posted on 2021-10-12 19:34  Sempron2800+  阅读(117)  评论(0编辑  收藏  举报