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

简介

select id, user_id, product_name, status, client_id, date from
(
    select id, user_id, product_name, status, client_id, date, count(1) over (partition by user_id) as num
    from order_info
    where product_name in ('C++', 'Python', 'Java')
    and status = 'completed' and date > '2025-10-15'
) as b
where b.num >= 2
order by id;

Hope is a good thing,maybe the best of things,and no good thing ever dies.----------- Andy Dufresne
原文地址:https://www.cnblogs.com/eat-too-much/p/14958828.html