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

某宝店铺动销率与售罄率

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

全部评论

相关推荐

想按时下班的大菠萝在...:隔壁学校的,加油多投, 实在不好找可以下个学期开学找,把算法八股准备好,项目有空再换换
投了多少份简历才上岸
点赞 评论 收藏
分享
昨天 21:57
已编辑
门头沟学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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