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

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

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

全部评论

相关推荐

迷茫的大四🐶:这就是他们口中的ai时代的一人公司
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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