题解 | #2021年国庆在北京接单3次及以上的司机统计信息#
2021年国庆在北京接单3次及以上的司机统计信息
https://www.nowcoder.com/practice/992783fd80f746d49e790d33ee537c19
select city,
round(avg(driver_cnt),3) as avg_order_num,
round(avg(fare_sum),3) as avg_income
from (
select city,driver_id,
count(driver_id) as driver_cnt,
sum(fare) fare_sum
from tb_get_car_record
join tb_get_car_order using (order_id)
where date(order_time) between '2021-10-01' and '2021-10-07'and city='北京'
group by driver_id
having count(driver_id)>=3
) df
group by city
