select s.staff_id,s.staff_name, concat(round(sa.dock_salary/sa.normal_salary*100,1),'%') as dock_ratio from staff_tb s join salary_tb sa on s.staff_id = sa.staff_id where s.department = 'dep1' order by dock_ratio desc
简单链接
select s.staff_id,s.staff_name, concat(round(sa.dock_salary/sa.normal_salary*100,1),'%') as dock_ratio from staff_tb s join salary_tb sa on s.staff_id = sa.staff_id where s.department = 'dep1' order by dock_ratio desc
简单链接