SELECT post, round(avg((TIMESTAMPDIFF(minute,first_clockin,last_clockin)/60)),3) work_hours FROM staff_tb a JOIN attendent_tb b USING(staff_id) GROUP BY post ORDER BY work_hours DESC