select s.post as post, avg(timestampdiff(second, first_clockin, last_clockin)/ (60*60)) as work_hours
from attendent_tb a
left join staff_tb s
on s.staff_id = a.staff_id 
group by s.post
order by work_hours DESC