题解 | #牛客的课程订单分析(五)#

牛客的课程订单分析(五)

http://www.nowcoder.com/practice/348afda488554ceb922efd2f3effc427

还有太多的东西需要学习,做完这一遍之后,反复做。

更重要的是反复的学习别人的解题思路,这很重要。

select user_id,max(if(date_rk=1,date,null)),max(if(date_rk=2,date,null)),max(cnt) 
from(select user_id,date,rank() over(partition by user_id order by date) date_rk,count(1) over(partition by user_id) cnt
    from order_info
    where date>'2025-10-15' and product_name in ('C++','Java','Python') and status='completed') t1
where cnt>=2
group by user_id
order by user_id
MySQL试题答案解析 文章被收录于专栏

MySQL在线编程重点试题解析

全部评论

相关推荐

10-17 23:18
已编辑
西北农林科技大学 Web前端
独行m:给25可以试试,但他只能给12,那就是纯纯的事精
秋招,不懂就问
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务