select st.department,concat(round(avg(case when timestampdiff(minute,at.first_clockin,at.last_clockin)/60 >9.5 then 1 else 0 end)*100,1),"%") ratio from staff_tb st right join attendent_tb at on st.staff_id=at.staff_id group by department order by ratio desc 统计加班员工占比,通过case when timesta...