select—有人知道如何在sql中合并两个或多个具体化视图吗?

wqlqzqxt  于 2021-07-29  发布在  Java
关注(0)|答案(1)|浏览(492)
  1. select *
  2. from
  3. (materialized_v1
  4. union all
  5. materialized_v2);
4sup72z8

4sup72z81#

你需要 select ,那么 union . 这里没有具体的物化视图:

  1. select * from materialized_v1
  2. union all
  3. select * from materialized_v2;

为此,两个视图的列数相同,数据类型相同。最好是在 select 子句,使您有机会在需要时调整列和数据类型:

  1. select col1, col2, col3 from materialized_v1
  2. union all
  3. select col4, col4, col5 from materialized_v2;

相关问题