自己还是比较习惯这种窗口函数的写法
select t.id ,t.is_group_buy, case when is_group_buy = 'No' then t.client_name else NULL end from (select tmp.*, sum(case when status='completed' then 1 else 0 end) over(partition by user_id) as cnt from (select a.* , b.name as client_name from order_info a left join client b on a.client_id = b.id ) tmp where status = 'completed' and date > '2025-10-15' and product_name in ('C++','Java','Python') ) t where t.cnt >= 2 order by id asc