@jmadren just realize posted about row_number() after I finish adding my comment.
Yes, Temp tables are also another way to go and would work as long as you use row_number() and reference in the select.
Starting to think this could easily fit in a store procedure.