select source,count(source) cnt
from(select case when is_group_buy='Yes' then 'GroupBuy' else name end source
from(select *
from(select *,count(user_id)over(partition by user_id) cn
from order_info
where date>'2025-10-15' and status='completed' and product_name in ('C++','Java','Python')) t
where cn>=2) t1 left join client c on t1.client_id=c.id) t2
group by source
order by source