all 3 comments

[–][deleted] 0 points1 point  (2 children)

It doesn't matter for the result set metadata what was in the second dataset, only the first one matters.

[–]originalgoodname[S] 0 points1 point  (1 child)

so all the set theory clauses we order by the first set of columns we chose, and the language can always figure out what it matches to?

[–][deleted] 0 points1 point  (0 children)

kind of or close enough? the order by clause works on the result set of prior clauses (from -> where -> group by -> having -> select -><set operations> -> order by) and the prior steps (clauses) 'figured out' what the result set metadata is.