select o.id,o.is_group_buy, case when o.is_group_buy="Yes" then NULL else c.name end as client_name from order_info o left join client c on o.client_id=c.id where o.date>"2025-10-15" and o.product_name in("C++","Java","Python") and o.status="completed" /*选择符合条件的user_id*/ and o.user_id in (select user_id from (select id,user_id,row_number() over (partition by user_id order by id) as rr from order_info where product_name in("C++","Java","Python") and status="completed")r where r.rr>=2) order by o.id