关注
这是看了你的答案后写的,能帮我看下我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;
点赞
相关推荐
嵌入式的小白:我同事说过一句话,不羡慕领导赚的比他多
点赞 评论 收藏
分享
点赞 评论 收藏
分享
2025-12-15 11:27
门头沟学院 Java 点赞 评论 收藏
分享
牛客热帖
更多
正在热议
更多
# 牛客吐槽大会 #
25448次浏览 323人参与
# 工作前VS工作后,你的心态变化 #
38497次浏览 267人参与
# 秋招想进国企该如何准备 #
125431次浏览 617人参与
# 你的mentor是什么样的人? #
51575次浏览 740人参与
# 从mentor身上学到了__ #
55611次浏览 886人参与
# 我和mentor的爱恨情仇 #
106677次浏览 968人参与
# 我的省钱小妙招 #
37592次浏览 446人参与
# 机械人避雷的岗位/公司 #
44842次浏览 320人参与
# 在大厂上班是一种什么样的体验 #
15092次浏览 223人参与
# 为了减少AI幻觉,你注入过哪些设定? #
7536次浏览 214人参与
# 职场上哪些行为很加分? #
323148次浏览 3618人参与
# 通信/硬件求职避坑tips #
139962次浏览 1087人参与
# 论秋招对个人心气的改变 #
16084次浏览 250人参与
# 你觉得mentor喜欢什么样的实习生 #
48746次浏览 1002人参与
# 你现在会用到哪些AI技能? #
24821次浏览 137人参与
# 牛客AI体验站 #
9316次浏览 230人参与
# 毕业论文进行时 #
27673次浏览 153人参与
# 运营来爆料 #
77442次浏览 467人参与
# 程序员找工作至少要刷多少题? #
24143次浏览 315人参与
# 过年最难忘的一件事 #
23326次浏览 179人参与
