这是看了你的答案后写的,能帮我看下我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;
点赞

相关推荐

07-03 11:02
中山大学 C++
字节刚oc,但距离九月秋招很近了有两段互联网实习,非腾讯字节。不敢赌转正,现在在纠结去还是不去如果实习俩月离职会有什么后果吗
阿城我会做到的:不去后悔一辈子,能否转正取决于ld的态度,只要他不卡,答辩就是走流程,个人觉得可以冲一把
投递字节跳动等公司9个岗位
点赞 评论 收藏
分享
测试糕手手:社会第一课,随便吹牛逼,直接说四个月,别老实。老实人只会被欺负
点赞 评论 收藏
分享
06-02 15:17
门头沟学院 Java
心爱的idea:怎么会呢 应该是打招呼有问题 问就说实习6个月全国可飞随时到岗
点赞 评论 收藏
分享
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务