select
a.id
,a.is_group_buy
,c.name
from (
select
*
from order_info
where 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
ORDER by user_id
)
and date > '2025-10-15'
and status = 'completed'
and product_name in ('C++','Python','Java')
order by id
) a
left join client c
on a.client_id = c.id
order by a.id