题解 | #统计各岗位员工平均工作时长#
统计各岗位员工平均工作时长
https://www.nowcoder.com/practice/b7220791a95a4cd092801069aefa1cae
SELECT post ,round(avg(TIMESTAMPDIFF(second, first_clockin,last_clockin)/3600),3) as work_hours FROM staff_tb a JOIN attendent_tb b ON a.staff_id = b.staff_id WHERE first_clockin IS NOT NULL AND last_clockin IS NOT NULL GROUP BY post ORDER BY work_hours DESC
美的集团公司福利 816人发布
