题解 | #某宝店铺动销率与售罄率#

某宝店铺动销率与售罄率

http://www.nowcoder.com/practice/715dd44c994f45cb871afa98f1b77538

这个题目有问题啊,正常动销率不是这么算的 with a as (select s.item_id,s.sales_num,s.sales_price,p.style_id from (select * from sales_tb)s left join (select * from product_tb)p on s.item_id=p.item_id)

select t1.style_id ,round((sold_num/(total_num-sold_num))*100,2),round((GMV/cost)100,2) from (select style_id, sum(inventory) total_num from product_tb group by style_id)t1 left join (select style_id,sum(sales_num) sold_num from a group by style_id)t2 on t1.style_id=t2.style_id left join (select style_id,sum(sales_price) GMV from a group by style_id)t3 on t1.style_id=t3.style_id left join (select style_id,sum(tag_priceinventory) cost from product_tb group by style_id)t4 on t1.style_id=t4.style_id order by t1.style_id

全部评论

相关推荐

不愿透露姓名的神秘牛友
03-15 10:59
已编辑
爱写代码的菜code...:哎,自己当时拿到字节offer的时候也在感叹终于拿到了,自己当时最想去的企业就是字节,结果还是阴差阳错去了鹅厂。祝uu一切顺利!!!
点赞 评论 收藏
分享
在干饭的比尔很纯真:个人信息不要露出来啊
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务