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

with tmp as (
select 
t1.staff_id
,t1.staff_name
,t2.normal_salary
,t2.dock_salary
from (select *
from staff_tb
where department = 'dep1') t1
left join salary_tb as t2
on t1.staff_id = t2.staff_id)

select 
t.staff_id as staff_id
,t.staff_name as staff_name
,concat(round(((t.dock_salary / t.normal_salary) * 100),1),'%') as dock_ratio
from tmp as t
order by dock_ratio desc;

全部评论

相关推荐

买蜜雪也用卷:我觉得应该没有哪个人敢说自己熟练使用git,代码分支一复杂还是得慢慢寻思一下的,不过基本的拉代码提交代码还有分支什么的是应该会
点赞 评论 收藏
分享
04-13 18:10
门头沟学院 Java
想熬夜的小飞象在秋招:被腾讯挂了后爸妈以为我失联了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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