- 参考答案
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(id)>=2
order by user_id
- 答案解析
本题对新同学来说难点在于
1.时间的比较
2.分组聚合
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(id)>=2
order by user_id