> Army wrote: > When the SelectExpression appears in a UNION, INTERSECT, > or EXCEPT operator, the names from the first SelectExpression > are taken as the names for the columns in the result of > the operation. > > But this doesn't appear to be true. Ex: > > ij> select a from t1 union select b from t2; > 1 // This "1" should be "A", according to doc. > ----------- > > So what needs to be corrected here? The documentation or the code? >
The code needs to be corrected. The documentation is correct. The rule explained by the doc is also why expressions in the first SelectExpression need to have aliases whereas expressions in the subsequent SelectExpressions do not require aliases.
