题解 | 统计员工薪资扣除比例
select s1.staff_id, s1.staff_name, concat(round((s2.dock_salary*100/s2.normal_salary),1),"%") dock_ratio from staff_tb s1 join salary_tb s2 on s1.staff_id= s2.staff_id where s1.department = 'dep1' order by dock_ratio desc;
select s1.staff_id, s1.staff_name, concat(round((s2.dock_salary*100/s2.normal_salary),1),"%") dock_ratio from staff_tb s1 join salary_tb s2 on s1.staff_id= s2.staff_id where s1.department = 'dep1' order by dock_ratio desc;
相关推荐