题解 | 分析各产品线在特定时间段内的销售情况

分析各产品线在特定时间段内的销售情况

https://www.nowcoder.com/practice/8a002dd7888b4247b6ac9228577bdbc3

# 以channel_name它进行排序的时候,它必须是select 后面出现过的数据
select product_line,region,channel_name,
sum(sale_amount) total_sale_amount,
count(product_id) total_sale_quantity
from (
    select product_line,region,channel_name,sc.channel_id,sale_amount,sd.product_id
    from sales_data sd join oppo_products o on sd.product_id = o.product_id
    join sales_channels sc on sd.channel_id = sc.channel_id
) t1
group by product_line,region,channel_name
order by product_line

全部评论

相关推荐

2025-12-17 17:15
华东师范大学 运营
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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