select t1.exp_type, round(avg(timestampdiff(second,t2.out_time,t2.in_time)/3600),1) as time from express_tb t1 left join exp_action_tb t2 on t1.exp_number = t2.exp_number group by t1.exp_type order by time asc
注意timestampdiff 使用hour做参数可能计算会报错
select t1.exp_type, round(avg(timestampdiff(second,t2.out_time,t2.in_time)/3600),1) as time from express_tb t1 left join exp_action_tb t2 on t1.exp_number = t2.exp_number group by t1.exp_type order by time asc
注意timestampdiff 使用hour做参数可能计算会报错