I have a query that UNION\'s two somewhat similar datasets, but they both have some columns that are not present in the other (i.e., the columns have NULL values in
A quick solution would be to do 2 inserts into a temp table or a table variable and as part of insert into the temp table you can set a flag column to help with sorting and then order by that flag column.