题解 | #牛客的课程订单分析(七)#
牛客的课程订单分析(七)
http://www.nowcoder.com/practice/d6f4a37f966145da8900ba9edcc4c068
select (case when t1.name is NULL then 'GroupBuy' else t1.name end) as source, count(1)
from client t1 right join
(
select *,count(id) over(partition by user_id) as number
from order_info
where datediff(date,"2025-10-15")>0
and status="completed"
and product_name in ("C++","Java","Python")
) t2
on t1.id=t2.client_id
where t2.number >1
group by t1.name
order by source;