题解 | #牛客的课程订单分析(六)#

牛客的课程订单分析(六)

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


with t as(
    select 
        distinct user_id,
        count(product_name) over(partition by user_id) cnt
    from order_info
    where status='completed' and date>'2025-10-15'
)


select 
    o.id,
    is_group_buy,
    c.name client_name
from order_info o
left join client c on o.client_id=c.id
left join t on o.user_id=t.user_id
where status='completed' 
and date>'2025-10-15'
and t.cnt>=2
and product_name in ('C++','Python','Java') 
order by o.id




全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务