题解 | 统计员工薪资扣除比例
统计员工薪资扣除比例
https://www.nowcoder.com/practice/08db6f0135664ca598b579f8d53dc486
select sb.staff_id, sb.staff_name, concat( round( ( sum(dock_salary)/sum(normal_salary))*100,1),"%") as dock_ratio from staff_tb sb inner join salary_tb tb on sb.staff_id=tb.staff_id where department="dep1" group by sb.staff_id order by dock_ratio desc