我用表连接也解决了,和where user_id in 是一个思路 select s2.id,s2.user_id,s2.product_name,s2.status,s2.client_id,s2.date from (select user_id from order_info where date>'2025-10-15' and status='completed' and product_name in ('C++','Java','Python') group by user_id having count(user_id)>=2) s1 left join (select * from order_info where date>'2025-10-15' and status='completed' and product_name in ('C++','Java','Python')) s2 on s1.user_id=s2.user_id order by s2.id
点赞

相关推荐

点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务