题解 | 深入分析各款产品年总销售额与竞品的年度对比

深入分析各款产品年总销售额与竞品的年度对比

https://www.nowcoder.com/practice/99cc7f1798a84645a6aca5bdfd163fdb

with sale_temp as (
select o.product_id,product_name,
sum(quarter_1_sales_amount+quarter_2_sales_amount+quarter_3_sales_amount+quarter_4_sales_amount) 
as total_sales_amount_of_product
from oppo_products_detail o
join sales_info s on s.product_id=o.product_id
group by o.product_id
)
select st.product_id,product_name,competitor_name,total_sales_amount_of_product,
total_sales_amount_of_product-total_competitor_sales_amount_2023 as sales_difference_with_competitor
from sale_temp st
join competitor_analysis c on c.product_id=st.product_id
order by product_id;

全部评论

相关推荐

黑着眼圈看手机:pdd秋招笔试挂了,春招还行吗
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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