有思路就能写出来,

select if(o.is_group_buy='Yes','GroupBuy',c.name)as source,count(o.client_id) from order_info as o left join client as c on o.client_id=c.id where o.date>'2025-10-15' and o.status='completed' and o.product_name in('C++','Python','Java') and o.user_id in( select user_id from order_info where date>'2025-10-15' and status='completed' and product_name in('C++','Python','Java') group by user_id having count(user_id)>=2 ) group by c.name order by source