题解 | 牛客的课程订单分析(六)
牛客的课程订单分析(六)
https://www.nowcoder.com/practice/c5736983c322483e9f269dd23bdf2f6f
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
