case when select N.name, count(N.name), round( sum(TIMESTAMPDIFF(second, N.event_time, N.order_time)) / count(N.name) / 60, 1 ), round( sum(TIMESTAMPDIFF(second, N.order_time, N.start_time)) / count(N.start_time) / 60, 1 ) from ( select ( case ...