有人知道如何合并 sql 中的两个或多个物化视图吗?
Someone knows how to union two or more materialized views in sql?
select *
from
(materialized_v1
union all
materialized_v2);
您需要select
,然后union
。这里没有具体的物化视图:
select * from materialized_v1
union all
select * from materialized_v2;
为此,两个视图都具有相同的列数和相同的数据类型。枚举 select
子句中的列要好得多,这样您就有机会根据需要调整列和数据类型:
select col1, col2, col3 from materialized_v1
union all
select col4, col4, col5 from materialized_v2;
select *
from
(materialized_v1
union all
materialized_v2);
您需要select
,然后union
。这里没有具体的物化视图:
select * from materialized_v1
union all
select * from materialized_v2;
为此,两个视图都具有相同的列数和相同的数据类型。枚举 select
子句中的列要好得多,这样您就有机会根据需要调整列和数据类型:
select col1, col2, col3 from materialized_v1
union all
select col4, col4, col5 from materialized_v2;