题解 | 统计加班员工占比

select s.department,
concat(round(avg(if((timestampdiff(minute,a.first_clockin,a.last_clockin)/60)>9.5,1,0))*100,1),'%') ratio
from staff_tb s
left join attendent_tb a
on s.staff_id=a.staff_id
group by s.department
order by ratio desc;

全部评论

相关推荐

评论
点赞
收藏
分享
牛客网
牛客企业服务