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

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

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

with t as
(select * from order_info where date>'2025-10-15' and status='completed' and product_name in ('Python','Java','C++'))
select t1.user_id,min(t1.date) first_buy_date,min_date
second_buy_date,count(*) cnt from t t1
join (select user_id,min(date) min_date from t where (user_id,date) not in (select user_id,min(date) from t group by user_id)
group by user_id ) t2
on t1.user_id=t2.user_id
group by t1.user_id order by t1.user_id;

全部评论

相关推荐

oppo 应用软开 22*15+0.5*12
拿到了ssp完美:真的坎坷,但是你至少拿到这么多offer了!
点赞 评论 收藏
分享
没有offer的小土豆:专业面试一般是分配面试官然后联系你面试 应该是还没给你分配对应面试官
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务