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

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

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

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

全部评论

相关推荐

04-17 10:16
门头沟学院 Java
小浪_coder:24届很难找了,马上25的都毕业了还有很多没找到的
点赞 评论 收藏
分享
05-26 09:07
已编辑
门头沟学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务