个人感觉这个好理解点

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