SELECT a.order_num FROM (SELECT order_num,SUM(quantity)AS num FROM OrderItems GROUP BY order_num)AS a WHERE num>100 ORDER BY a.order_num; 可用子查询先将符合条件的筛选出来;也可用HAVING将条件直接筛选