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

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

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

with
t1 as(
    select
        product_line,
        region,
        channel_id,
        channel_name,
        sum(sale_amount) as total_sale_amount,
        count(product_id) as total_sale_quantity
    from
        sales_data
        left join oppo_products using(product_id)
        left join sales_channels using(channel_id)
    group by
        product_line,
        region,
        channel_id,
        channel_name
)

select
    product_line,
    region,
    channel_name,
    total_sale_amount,
    total_sale_quantity
from
    t1
order by
    product_line,
    channel_id

全部评论

相关推荐

卡卡罗特ovo:说起云智我就来气,约好了一面,结果面试官没来,ssob上问hr也未读,我还是专门请了半天假在家面试,恶心死了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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