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

京公网安备 11010502036488号