with
t1 as(
select
oi.id as id,
user_id,
count(user_id)over(partition by user_id) as course_cnt,
product_name,
name,
date,
is_group_buy as igb
from
order_info as oi left join client as c on oi.client_id=c.id
where
date>'2025-10-15'
and
status='completed'
and
product_name in ('C++','Java','Python')
),
t2 as(
select
id,
igb,
name
from
t1
where
course_cnt>=2
order by
id
)
select * from t2

京公网安备 11010502036488号