题解 | #某宝店铺动销率与售罄率#尤其简单明了不易出错版!

某宝店铺动销率与售罄率

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

select style_id,
			 round(sum(item_sum)/sum(inventory-item_sum)*100,2) as pin_rate,
			 round(sum(sales_price_sum)/sum(tag_price*inventory)*100,2) as sell_through_rate
#select * ##习惯这样查看一下数据结构
from product_tb
left join (select item_id,
									sum(sales_price) as sales_price_sum,
									sum(sales_num) as item_sum
					 from sales_tb
					 group by item_id) as t1 using(item_id)
group by style_id
order by style_id
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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