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

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

http://www.nowcoder.com/practice/c93d2079282f4943a3771ca6fd081c23

select distinct t1.user_id
,min(date) over(partition by t1.user_id) as first_buy_date
,t1.count_cnt from (
select user_id,date,status,product_name
,count(if((date>='2025-10-15'
          and status='completed'
          and (product_name='C++' 
               or product_name='Java' 
               or product_name='Python')),1,null))
               over(partition by user_id) as count_cnt 
               from order_info) t1 
               where t1.count_cnt >= 2 
               and t1.date>='2025-10-15'
          and t1.status='completed'
          and (t1.product_name='C++' 
               or t1.product_name='Java' 
               or t1.product_name='Python')
               order by t1.user_id

全部评论

相关推荐

没有offer的呆呆:薪资有的时候也能说明一些问题,太少了活不活得下去是一方面,感觉学习也有限
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务