题解 | #牛客的课程订单分析(七)#
牛客的课程订单分析(七)
https://www.nowcoder.com/practice/d6f4a37f966145da8900ba9edcc4c068
select * from (select case when a.is_group_buy='Yes' then 'GroupBuy' else a.name end as source, count(*) as cnt from (select o.*, c.name, count(1)over(partition by user_id) as cnt from order_info o left join client c on o.client_id=c.id where date>='2025-10-15' and product_name in ('Java','python','C++') and status='completed') a where a.cnt>=2 group by 1) b order by source