题解 | 牛客的课程订单分析(六)
牛客的课程订单分析(六)
https://www.nowcoder.com/practice/c5736983c322483e9f269dd23bdf2f6f
select a.id,a.is_group_buy,
case when a.is_group_buy='yes' then null else c.name end cilent_name
from (
select id, is_group_buy, client_id,
count(*) over(partition by user_id) cnt
from order_info
where status='completed'
and date > '2025-10-15'
and product_name in ('C++','Java','Python')
) a
left join client c
on a.client_id=c.id
where a.cnt>1
order by a.id

