题解 | #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

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

全部评论

相关推荐

06-14 19:09
门头沟学院 Java
darius_:给制造业搞的,什么物料管理生产管理,设备管理点检,最最关键的就是一堆报表看板。个人觉得没啥技术含量都是些基本的crud,但是业务很繁琐那种
点赞 评论 收藏
分享
后来123321:别着急,我学院本大二,投了1100份,两个面试,其中一个还是我去线下招聘会投的简历,有时候这东西也得看运气
无实习如何秋招上岸
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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