题解 | #2021年国庆在北京接单3次及以上#

2021年国庆在北京接单3次及以上的司机统计信息

https://www.nowcoder.com/practice/992783fd80f746d49e790d33ee537c19

select
    '北京' as city,
    round(avg(cnt),3) as avg_order_num,
    round(avg(sumfare) ,3)as avg_income
from (select 
    driver_id,
    count(*) as cnt,
    sum(fare) as sumfare
from (select o.driver_id,o.fare
from tb_get_car_record r join tb_get_car_order o
on r.order_id = o.order_id where r.city = '北京' and o.finish_time between '2021-10-01' and '2021-10-07') t group by driver_id having count(*) >= 3) p 
  1. finish_time between '2021-10-01' and '2021-10-07'
  2. having count(*) >= 3
  3. city = '北京'
全部评论

相关推荐

shtdbb_:还不错,没有让你做了笔试再挂你
点赞 评论 收藏
分享
点赞 评论 收藏
分享
小红书 后端开发 总包n+8w+期权
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务