Was this helpful?
UNION — Derived Result Column Name
With most DBMSs, the result column name for a UNION select is simply the column names in the first select.
SELECT column_a FROM table_a
UNION
SELECT column_b FROM table_b
ORDER BY column_a ;
When using Terminal monitor or in reports where column names are significant, we recommend that you assign all expressions an explicit alias.
This also applies to queries that make use of derived tables.
Last modified date: 02/16/2024