select ifnull(inf.product_id,"店铺汇总") productid , concat(round((1-sum(in_price*cnt)/sum(price*cnt))*100,1),"%") profit_rate from tb_product_info inf inner join tb_order_detail det on inf.product_id = det.product_id inner join tb_order_overall ove on det.order_id = ove.order_id where shop_id = 901 and date(event_time)>="2021-10-01" group by inf.product_id with rollup having profit_rate>24.9 or productid is null order by productid 求问感觉逻辑一样的 为什么店铺汇总还是在最后一行呀
1

相关推荐

08-04 22:37
桂林学院 Java
行不行阿细GO:说真的我现在看到校招java简历都头痛。。千篇一律和阅卷高考作文差不多,估计公司也是吧,到最后就看学历和大厂实习了
投递BOSS直聘等公司10个岗位
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务