select cast(avg(abs(timestampdiff(second,o.logtime,s.logtime))) as unsigned ) as gap from order_log o join select_log s using(order_id);

select cast(avg(abs(timestampdiff(second,o.logtime,s.logtime))) as unsigned ) as gap from order_log o join select_log s using(order_id);