题解 | 牛客的课程订单分析(二)
牛客的课程订单分析(二)
https://www.nowcoder.com/practice/4ca4137cb490420cad06d2147ae67456
with
t1 as(
select
user_id,
product_name,
status,
date,
count(status)over(partition by user_id) as counts
from
order_info
where
status='completed'
and
product_name in ('C++','Java','Python')
and
timestampdiff(day,'2025-10-15',date)>0
)
# select * from t1
select distinct user_id from t1 where counts>=2 order by user_id

查看10道真题和解析