Union allows for combining a number of Select statements together, one after the other.
The difference between Union and Union All, is that Union will remove duplicate rows, and Union All will include duplicate rows.
To do an Order By for the data I have Unioned together, I can wrap the Unions into a bracketed From, and do the Order By after this Temp Tabled From…
Union — This has no duplicates.
— Union All — This does have duplicates.
) As Tmp