In this case we have to build two tables first, one with the SALESORDERs, one with the ORDERITEMs. The ORDERITEMs is simple, we just take all rows that belong to the item level plus the SALES_ORDER_NUMBER - we need that to join both tables later.
And how do we get a list of all orders, in other words a "table" with the primary key SALES_ORDER_NUMBER? We take all order attributes including the key and perform a "select distinct".
Now we have two queries as output which look just like the SALESORDER and ORDERITEM tables of before and we can start the nesting.