题解 | #国庆期间近7日日均取消订单量#

国庆期间近7日日均取消订单量

https://www.nowcoder.com/practice/2b330aa6cc994ec2a988704a078a0703




select '2021-10-01' as dt , round(count(start_time)/7,2), round((count(*)-count(start_time))/7,2)
from tb_get_car_order 
where date(order_time) between '2021-09-25' and '2021-10-01'
union 
select '2021-10-02' as dt , round(count(start_time)/7,2), round((count(*)-count(start_time))/7,2)
from tb_get_car_order 
where date(order_time) between '2021-09-26' and '2021-10-02'
union 
select '2021-10-03' as dt , round(count(start_time)/7,2), round((count(*)-count(start_time))/7,2)
from tb_get_car_order 
where date(order_time) between '2021-09-27' and '2021-10-03'


全部评论

相关推荐

05-19 16:41
复旦大学 Python
ynq2126:我一直觉得现在考算法题没啥意义 真要选拔人才不如把公司实际项目中遇到的问题当成一系列场景题抛给求职者答 这才是能检测能力的东西
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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