with a as(
select city,event_time,date(event_time) as dt,start_time,end_time
from tb_get_car_record t2,tb_get_car_order t1
where t1.order_id=t2.order_id and month(event_time)=10
)
select city,max(cnt) max_wait_uv from
(select city,dt,
(select sum(case when a.event_time>=b.event_time and a.event_time<=b.start_time then 1 else 0 end)
from a as b
where a.dt=b.dt and a.city=b.city) as cnt
from a)b
group by city