题解 | 统计员工薪资扣除比例

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

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务