select o.id ,is_group_buy ,if(is_group_buy='Yes','None',name) client_name from order_info o left join client c on o.client_id=c.id where user_id in ( select user_id from order_info a where date>'2025-10-15' and product_name in ('C++','Java','Python') and status='completed' group by user_id having count(user_id)>=2 ) and product_name in ('C++','Java','Python') and status='completed' and date>'2025-10-15' group by o.id order by o.id
思路:因为我是根据通过率的顺序刷的,此题跟83题大同小异,稍微改一下就好了
83#牛客的课程订单分析(七)#