with flitered_order_info as (
select
*,
count(*) over (partition by user_id) as cnt
from
order_info
where
date >= '2025-10-15'
and
product_name in ('C++','Python','Java')
and
status = 'completed'
)
select
user_id,
min(date) as first_buy_date,
min(cnt) as cnt
from
flitered_order_info
where
cnt >= 2
group by
user_id
order by
user_id


京公网安备 11010502036488号