select 
post
,round(avg(个人时长),3) work_hours
from
(
	select 
	t1.post
	,t1.staff_id
	,timestampdiff(second,t2.first_clockin,t2.last_clockin)/3600 个人时长
	from staff_tb t1
	join attendent_tb t2
	on t1.staff_id = t2.staff_id
) s1
group by 1
order by 2 desc