关注
这是看了你的答案后写的,能帮我看下我10-2号的数据哪里错了吗,自测运行都是对的,提交结果2号 的数据就不对 with t1 as (select '2021-10-01' dt,count(distinct a.product_id) ct from tb_order_detail a join tb_order_overall b on a.order_id=b.order_id join tb_product_info c on a.product_id=c.product_id where date(b.event_time) between date_sub('2021-10-01',interval 6 day) and '2021-10-01' and c.shop_id='901' union select '2021-10-02' dt,count(distinct a.product_id) ct from tb_order_detail a join tb_order_overall b on a.order_id=b.order_id join tb_product_info c on a.product_id=c.product_id where date(b.event_time) between date_sub('2021-10-02',interval 6 day) and '2021-10-02' and c.shop_id='901' union select '2021-10-03' dt,count(distinct a.product_id) ct from tb_order_detail a join tb_order_overall b on a.order_id=b.order_id join tb_product_info c on a.product_id=c.product_id where date(b.event_time) between date_sub('2021-10-03',interval 6 day) and '2021-10-03' and c.shop_id='901' ) select dt,round(ct/(select count(distinct product_id) from tb_product_info where shop_id='901'),3),round(1-ct/(select count(distinct product_id) from tb_product_info where shop_id='901'),3) from t1 order by dt;
点赞
相关推荐
点赞 评论 收藏
分享
点赞 评论 收藏
分享
牛客热帖
更多
正在热议
更多
# 腾讯求职进展汇总 #
374774次浏览 3091人参与
# 饿了么求职进展汇总 #
13232次浏览 137人参与
# 神州信息求职汇总 #
40925次浏览 289人参与
# 牛友故事会 #
12899次浏览 343人参与
# 我在牛爱网找对象 #
155805次浏览 1196人参与
# 面试常问题系列 #
12170次浏览 402人参与
# 比亚迪求职进展汇总 #
657329次浏览 3013人参与
# 面试中,你被问过哪些奇葩问题? #
55615次浏览 686人参与
# 硬件应届生薪资是否普遍偏低? #
62839次浏览 489人参与
# 通信/硬件的薪资开多少,才值得去? #
51829次浏览 387人参与
# 蚂蚁求职进展汇总 #
24252次浏览 253人参与
# 2025退税开始啦 #
19639次浏览 290人参与
# 职场中你干过哪些“蠢”事 #
90520次浏览 481人参与
# 2022毕业即失业取暖地 #
89936次浏览 640人参与
# 2022毕业生求职现身说法 #
75826次浏览 665人参与
# 职场新人生存指南 #
251939次浏览 6029人参与
# 通信硬件公司爆料 #
124897次浏览 507人参与
# 面试时被问的最奇葩的问题 #
15101次浏览 89人参与
# 汇川技术求职进展汇总 #
106961次浏览 747人参与
# 硬件人的春招flag #
35340次浏览 381人参与
# 同bg的你秋招战况如何? #
140439次浏览 900人参与