select post, round(avg(timestampdiff(second,first_clockin,last_clockin)/3600),3) as work_hours from staff_tb join attendent_tb using(staff_id) where first_clockin is not null group by post order by work_hours desc 知识点:timestampdiff()函数的使用易错点:1)不能对timestampdiff直接用hour,用second/minute换算小时重新计算工作时长。注意tim...