select '01' as NAME from tablea
union all
select '02' as NAME from tableb
The resulting column name is '01', not NAME. This is not SQL standard compliant behaviour.
Cheers,
Martin
|
To clarify this behaviour only manifests itself when creating a new table from the union.
create table combinedtable
select '01' as NAME from tablea
union all
select '02' as NAME from tableb
select * from combinedtable
will return '01' as the column header.
|