思路:
①先找出符合要求的user_id
select user_id from order_info
where date > "2025-10-15"
and status = "completed"
and product_name in ("C++","Java","Python")
GROUP by user_id
having COUNT(id) > 1

②从符合要求的user_id里,连接order_info和client表。

select a.id,a.is_group_buy,c.name
from order_info as a
LEFT JOIN client as c
on a.client_id=c.id
where user_id in(
select user_id from order_info
where date > "2025-10-15"
and status = "completed"
and product_name in ("C++","Java","Python")
GROUP by user_id
having COUNT(id) > 1 )
and date > "2025-10-15"
and status = "completed"
and product_name in ("C++","Java","Python")