select user_id
from order_info
where status='completed'
and product_name in ('C++','Java','Python')
and datediff(date,'2025-10-15')>0
group by user_id
having count(*)>1
order by user_id
  • 注意筛选条件
  • 日期
  • 课程
  • 订单状态
  • 使用having筛选下单数大于1的用户