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

京公网安备 11010502036488号