题解 | #牛客的课程订单分析(六)#
牛客的课程订单分析(六)
http://www.nowcoder.com/practice/c5736983c322483e9f269dd23bdf2f6f
在牛客的课程订单分析(四)的基础上左连接即可
SELECT
a.id,
a.is_group_buy,
b.name client_name
FROM
(
SELECT
*,
ROW_NUMBER() over(partition by user_id order by date) r,
count(product_name) over(partition by user_id) cnt
from order_info
where status='completed'
and date>'2025-10-15'
and product_name in('C++','Java','Python')
)a
left join client b
on a.client_id=b.id
where a.cnt>=2
group by 1
order by 1