题解 | #牛客的课程订单分析(六)#
牛客的课程订单分析(六)
http://www.nowcoder.com/practice/c5736983c322483e9f269dd23bdf2f6f
1.分析
右连接+窗口函数
2.代码
select t2.id,t2.is_group_buy,t1.name as client_name from client t1 right join ( select *,count(id) over(partition by user_id) as number from order_info where datediff(date,"2025-10-15")>0 and status="completed" and product_name in ("C++","Java","Python") ) t2 on t1.id=t2.client_id where t2.number >1 order by t2.id