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

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

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

select 
post
,round(avg(个人时长),3) work_hours
from
(
	select 
	t1.post
	,t1.staff_id
	,timestampdiff(second,t2.first_clockin,t2.last_clockin)/3600 个人时长
	from staff_tb t1
	join attendent_tb t2
	on t1.staff_id = t2.staff_id
) s1
group by 1
order by 2 desc

全部评论

相关推荐

点赞 评论 收藏
分享
Rac000n:淘天-客户运营部-AI研发工程师,智能客服方向,暑期实习招聘,欢迎联系
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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