订单条件:
-------------2025-10-15之后
-------------产品为C++,Java,Python
-------------状态为成功的
子查询中完成这个需求,并根据user_id分组计算出用户成功的订单总数cnt
外层查询获取子查询中cnt>=2的user_id,并对user_id升序
select user_id from
(
select user_id,count(status) as cnt from order_info
where date > '2025-10-15'
and status = 'completed'
and product_name in ('Java','C++','Python')
group by user_id
) a
where a.cnt >=2
order by user_id asc