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

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

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

1.t1表 2021年国庆7天在北京接单3次及以上的司机的接单数目和收入数目

注意司机接单但被用户取消的订单也算在接单数内

2.计算平均接单数和平均兼职收入

select '北京' as city,
round(avg(cnt),3) avg_order_num,
round(avg(income),3) avg_income
from 
(select 
driver_id, count(t2.order_id) cnt,
sum(fare) income
from 
tb_get_car_order t1 
join 
tb_get_car_record t2
using(order_id)
where date(order_time) between '2021-10-01' and '2021-10-07'
and city='北京'
group by driver_id
having cnt>=3)t1
全部评论
该牛油正在参与牛客写题解薅羊毛的活动,牛币,周边,京东卡超多奖品放送,活动进入倒计时!快来捡漏啦https://www.nowcoder.com/discuss/888949?source_id=profile_create_nctrack&channel=-1
点赞 回复 分享
发布于 2022-04-27 12:15

相关推荐

Ncsbbss:又想干活又想要工资,怎么什么好事都让你占了
点赞 评论 收藏
分享
炫哥_:哥们项目描述里面vector和mysql之类的都要写吗,直接开头技术栈巴拉巴拉就行了,完全不是技术点啊
点赞 评论 收藏
分享
评论
3
1
分享

创作者周榜

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