思路:count()over
select
id
,user_id
,product_name
,status
,client_id
,date
from
(
select
*
,count(user_id)over(partition by user_id) total
from order_info
where date > '2025-10-15'
and status = 'completed'
and product_name in ('C++','Java','Python')
) a
where total>=2
order by id
select
id
,user_id
,product_name
,status
,client_id
,date
from
(
select
*
,count(user_id)over(partition by user_id) total
from order_info
where date > '2025-10-15'
and status = 'completed'
and product_name in ('C++','Java','Python')
) a
where total>=2
order by id