题解 | 分析每个商品在不同时间段的销售情况

分析每个商品在不同时间段的销售情况

https://www.nowcoder.com/practice/eec7a93e1ab24233bd244e04e910d2f9

select distinct product_id,product_name ,q2_2024_sales_total , dense_rank() over ( partition by category order by q2_2024_sales_total desc ) as category_rank,supplier_name
from (
    select distinct order_info.product_id,product_name, if(order_date>'2024-06-30'or order_date<'2024-04-01',0,sum(total_amount) over (partition by product_id) )as q2_2024_sales_total,
           supplier_name,order_date,category
    from product_info join order_info
    on product_info.product_id=order_info.product_id
    join supplier_info on product_info.product_id=supplier_info.product_id

     ) as t
order by product_id

全部评论

相关推荐

不愿透露姓名的神秘牛友
昨天 17:04
点赞 评论 收藏
分享
递归到脑子变傻:杭州还有上位机用VB的,实在没绷住
点赞 评论 收藏
分享
求求要我吧:你教育经历放在下面干什么,而且27届还是28届啊()另外看你简历有两面,通常来说投递运营岗位一面简历就够了。另外个人总结要写也放在简历最下面,然后你奖项那里是2019年的哇哈哈,那你究竟投递的是社招还是实习?实习的话你是第几届是肯定要写出来的,社招的话你这个工作经历又太短太花了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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