题解 | #统计各个部门的工资记录数#
统计各个部门的工资记录数
https://www.nowcoder.com/practice/6a62b6c0a7324350a6d9959fa7c21db3
select distinct dept_no,dept_name, count(dept_name) over (partition by dept_no) as sum from (select b.emp_no,a.dept_no,a.dept_name,c.salary from departments as a,dept_emp as b,salaries as c where a.dept_no=b.dept_no and b.emp_no=c.emp_no ) as d