select city, round(sum(cnt)/count(distinct driver_id),3) as avg_order_num, round(sum(1s)/count(distinct driver_id),3) as avg_income from( select driver_id, sum(fare) as 1s, count(order_time) as cnt from tb_get_car_record as t1 inner join tb_get_car_order as t2 on t1.order_id = t2.order_id where city = '北京' and date(order_time) between '2021-10-01' and '2021-10-07' group by driver_id having count(order_time)>=3 ) as t