select order_num
from OrderItems
group by order_num
having sum(quantity)>=100
order by order_num;

要根据SQL执行顺序,不能用where,而是用having,分组后再筛选