题解 | #统计各岗位员工平均工作时长#

统计各岗位员工平均工作时长

https://www.nowcoder.com/practice/b7220791a95a4cd092801069aefa1cae

select 
t1.post,
round(avg(t1.hour_diff)/60,3) as work_hours
from (
    select 
    *,
    timestampdiff(minute,first_clockin,last_clockin) as hour_diff
    from attendent_tb at
    left join staff_tb st
    using(staff_id)
)as t1
group by t1.post
order by work_hours desc;

全部评论

相关推荐

不愿透露姓名的神秘牛友
07-23 14:10
柴子木:找个工作你还发上脾气了🤣
点赞 评论 收藏
分享
Gaynes:查看图片
点赞 评论 收藏
分享
07-25 10:39
门头沟学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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