You are trying to do a cross tab function. This could give you all
sorts of problems if your orders have more than ten products.
I Assume that you can only have one invoice per order.
First job is to validate the data and resolve any issues there.
If this is a one off I would drop it into something like Excel that has
cross tab capability (pivot tables) then, if you must, load it into your
table from there.
If you need to repeat this frequently you need to write a stored
procedure that will read your two existing tables joining on order
number and sorted to invoice number. You can then construct each row
for your new table on change of order number.
Good luck