题解 | 统计加班员工占比

统计加班员工占比

https://www.nowcoder.com/practice/6c0a521c36e14c7599eaef858f6f8233


select 
sb.department,
concat(
round(
(
count(distinct case when timestampdiff(second,first_clockin,last_clockin)/3600>9.5  then sb.staff_id end)/count(distinct sb.staff_id))*100,1),"%") as ratio

from staff_tb sb inner join attendent_tb ab 
on sb.staff_id=ab.staff_id
group by sb.department
order by ratio desc

全部评论

相关推荐

迷茫的大四🐶:那你问他上班之后老实了没
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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