关注
这是看了你的答案后写的,能帮我看下我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;
点赞
相关推荐
点赞 评论 收藏
分享
05-25 15:08
南昌大学 前端工程师 点赞 评论 收藏
分享
06-03 03:20
河北农业大学 人力资源专员/助理 点赞 评论 收藏
分享
牛客热帖
更多
正在热议
更多
# 第一份工作应该选高薪还是热爱? #
66689次浏览 592人参与
# 不考虑薪资和职业,你最想做什么工作呢? #
92048次浏览 678人参与
# 秋招签约后的心态变化 #
82489次浏览 813人参与
# 听劝,这个公司值得去吗 #
486039次浏览 1700人参与
# 你觉得早上几点上班合适? #
72316次浏览 303人参与
# 学历贬值真的很严重吗? #
24420次浏览 173人参与
# 机械人与华为的爱恨情仇 #
120141次浏览 957人参与
# 一人推荐一个值得去的通信/硬件公司 #
186459次浏览 1859人参与
# 打工人的工作餐日常 #
53175次浏览 415人参与
# 哪些公司真双非友好? #
15819次浏览 82人参与
# 26届的你们有几段实习? #
43873次浏览 486人参与
# 月薪多少能在一线城市生存 #
27767次浏览 303人参与
# 双非能在秋招上岸吗? #
221707次浏览 1172人参与
# 你以为的实习VS真实的实习 #
29567次浏览 272人参与
# 今年秋招哪家公司给的薪资最良心? #
252851次浏览 1417人参与
# 你后悔自己读研吗? #
20473次浏览 240人参与
# 当下环境,你会继续卷互联网,还是看其他行业机会 #
117890次浏览 812人参与
# 追觅科技求职进展汇总 #
18224次浏览 120人参与
# 实习想申请秋招offer,能不能argue薪资 #
149883次浏览 932人参与
# 如何KTV领导 #
62765次浏览 472人参与