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

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

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

select d.user_id as id,d.date as d1,c.date as d2,d.count as count from ( select a.user_id as user_id,min(b.date) as date,a.count from ( select user_id,min(date)as date,count(user_id)as count from order_info where product_name in ('C++','Python','Java') and status='completed' and date>'2025-10-15' group by(user_id) having count('user_id')>=2 order by user_id )as a left join order_info as b on a.user_id=b.user_id where b.date>a.date and b.date>'2025-10-15' and b.status='completed' group by a.user_id order by b.date asc )as c left join ( select user_id,min(date)as date,count(user_id)as count from order_info where product_name in ('C++','Python','Java') and status='completed' and date>'2025-10-15' group by(user_id) having count('user_id')>=2 order by user_id )as d on c.user_id=d.user_id order by d.user_id asc 只要有思路就能写出来。

全部评论

相关推荐

10-14 23:01
已编辑
中国地质大学(武汉) Java
CUG芝士圈:虽然是网上的项目,但最好还是包装一下,然后现在大部分公司都在忙校招,十月底、十一月初会好找一些。最后,boss才沟通100家,别焦虑,我去年暑假找第一段实习的时候沟通了500➕才有面试,校友加油
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务