题解 | 统计各岗位员工平均工作时长
统计各岗位员工平均工作时长
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

查看15道真题和解析