select
t1.*
from
order_info t1
inner join
(select
user_id
from
order_info
where
status='completed'
and product_name in('C++','Java','Python')
and date>'2025-10-15'
group by
user_id
having
count(id)>=2) t2
on
t1.user_id=t2.user_id
where
status='completed'
and product_name in('C++','Java','Python')
and date>'2025-10-15'
order by
t1.id



京公网安备 11010502036488号