关注
这是看了你的答案后写的,能帮我看下我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;
点赞
相关推荐
点赞 评论 收藏
分享
牛客热帖
更多
正在热议
更多
# 你最近因为什么迷茫? #
13669次浏览 203人参与
# AI coding的好用工具分享 #
4231次浏览 107人参与
# 上班以后,你还有哪些坚持的爱好? #
1980次浏览 55人参与
# 实习怎么做才有更好的产出 #
2836次浏览 82人参与
# 你都在哪些场所面过试? #
5115次浏览 85人参与
# 实习生工资多少才算正常? #
4330次浏览 91人参与
# 实习心态崩了 #
100700次浏览 515人参与
# 你给AI提过哪些离谱的需求? #
1985次浏览 74人参与
# 找工作以来,你最看不惯__ #
3336次浏览 77人参与
# 领导做过最不靠谱的事 #
5361次浏览 92人参与
# 哪些公司开春招了? #
2301次浏览 34人参与
# 你最希望上岸的公司是? #
181633次浏览 800人参与
# 华为保温 #
169889次浏览 643人参与
# 你觉得第一学历对求职有影响吗? #
222414次浏览 1230人参与
# 刚入职就____,这样正常吗? #
124629次浏览 665人参与
# 秋招有哪些公司要求提前实习 #
103069次浏览 547人参与
# 非技术岗投递进展 #
166726次浏览 1317人参与
# 新年的第一句祝福 #
53683次浏览 389人参与
# 华子oc时间线 #
1408623次浏览 6994人参与
# 当发现同事想辞职 #
13674次浏览 47人参与