题解 | 统计加班员工占比
select s.department, concat(round(avg(if((timestampdiff(minute,a.first_clockin,a.last_clockin)/60)>9.5,1,0))*100,1),'%') ratio from staff_tb s left join attendent_tb a on s.staff_id=a.staff_id group by s.department order by ratio desc;