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