select a.post, round(avg(TIMESTAMPDIFF(minute,b.first_clockin , b.last_clockin)/60),3) as work_hours from staff_tb a join attendent_tb b on a.staff_id = b.staff_id where b.first_clockin is not null and b.last_clockin is not null group by a.post order by work_hours desc; 我觉得看到一个取数需求就要按如下这个标准化流程思考(只是个...