SELECT order_num,count(*) as order_lines FROM  OrderItems 
group by order_num order by order_lines