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

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

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

select 
city,
round(avg(avg_order_num),3) as avg_order_num,
round(avg(avg_income),3) as avg_income
from
(   
    select 
    t1.city as city,
    t2.driver_id,
    round(count(t2.order_id),3) as avg_order_num,
    round(sum(t2.fare),3) as avg_income
    from tb_get_car_record t1
    left join tb_get_car_order t2
    on t1.uid = t2.uid
    and t1.order_id = t2.order_id
    where date(t1.event_time) between '2021-10-01' and '2021-10-07'
    and t1.order_id is not null
    and t1.city = '北京'
    group by t1.city,t2.driver_id
) t
where avg_order_num >= 3
group by city

一直在考虑要不要在where后面加一句and t2.fare is not null

结果就是 接了单 取消了 也算接单了 真就令人无语

全部评论

相关推荐

牛客83700679...:简历抄别人的,然后再投,有反馈就是简历不行,没反馈就是学历不行,多投多改只要技术不差机会总会有的
点赞 评论 收藏
分享
Lorn的意义:1.你这根本就不会写简历呀,了解太少了 2.你这些项目经历感觉真的没啥亮点啊,描述的不行,重写书写一下让人看到核心,就继续海投 注意七八月份ofer还是比较多的,越往后机会越少,抓住时机,抓紧检查疏漏,加油查看图片
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务