Column list should not be required when creating views based on UNION statements.
Column names should be the same as when the SELECT query is run outside the view.
"The column identifiers of the output set are those specified in the first SELECT specification.
If you would like to use alternative column names, column aliasing can be used in the
output list of the first SELECT specification"
Description
Column list should not be required when creating views based on UNION statements.
Column names should be the same as when the SELECT query is run outside the view.
"The column identifiers of the output set are those specified in the first SELECT specification.
If you would like to use alternative column names, column aliasing can be used in the
output list of the first SELECT specification"
Dmitry Yemanov added a comment - 27/Apr/09 11:38 PM Test cases:
recreate view V1 as
select d.rdb$relation_id from rdb$database d
union all
select d.rdb$relation_id from rdb$database d
recreate view V2 as
select d.rdb$relation_id as q from rdb$database d
union all
select d.rdb$relation_id as w from rdb$database d
recreate view V3 as
select a from (select 1 a from rdb$database)
union all
select b from (select 1 b from rdb$database)
recreate view V4 as
select a as a1 from (select 1 a from rdb$database)
union all
select b as b1 from (select 1 b from rdb$database)
recreate view V1 as
select d.rdb$relation_id from rdb$database d
union all
select d.rdb$relation_id from rdb$database d
recreate view V2 as
select d.rdb$relation_id as q from rdb$database d
union all
select d.rdb$relation_id as w from rdb$database d
recreate view V3 as
select a from (select 1 a from rdb$database)
union all
select b from (select 1 b from rdb$database)
recreate view V4 as
select a as a1 from (select 1 a from rdb$database)
union all
select b as b1 from (select 1 b from rdb$database)