题解 | #2021年国庆在北京接单3次及以上的司#
2021年国庆在北京接单3次及以上的司机统计信息
https://www.nowcoder.com/practice/992783fd80f746d49e790d33ee537c19
select city,round(avg(num),3) as avg_order_num , round(avg(sum1),3) as avg_income from ( select driver_id,city,count(*) as num ,sum(fare) as sum1 from tb_get_car_record join tb_get_car_order using(order_id) where city='北京' and date(order_time) between '2021-10-1'and '2021-10-7' group by driver_id ,city having count(*)>=3 )t group by city
接单就算
注意条件,北京、国庆 ,接单量>=3