select order_num
from 
(
select order_num, sum(quantity) as sum_num
from OrderItems 
group by order_num
)a 
where a.sum_num >=100
order by order_num