题解 | #牛客的课程订单分析(四)#
牛客的课程订单分析(四)
https://www.nowcoder.com/practice/c93d2079282f4943a3771ca6fd081c23
select
user_id,
date as first_buy_date,
cnt
from
(
select
*,
count(product_name) over (partition by user_id) as cnt,
row_number() over (partition by user_id order by date) as buy_date_rank
from
order_info
where
status = 'completed'
and product_name in ('C++', 'Java', 'Python')
and date > '2025-10-15'
) a
where cnt >= 2 and buy_date_rank = 1
order by
user_id
文远知行公司福利 551人发布
