0

架构名称:A,B

两种模式都有相同的表:

表名:stock。菲尔兹no,Stname

我想从两个骗局的库存表中检索详细信息。

所以我使用这个查询:

 select no,stname from A.stock union all select no,stname from B.stock

我想在没有联合的情况下获得表格的详细信息。可能吗 ?怎么做 ?

我正在使用 postgresql 9.0

4

1 回答 1

1

以下是您的查看方式:

CREATE OR REPLACE VIEW union_of_my_stock_tables AS 
 select no,stname from A.stock 
 union all 
 select no,stname from B.stock;
union all 
 select no,stname from C.stock;
union all 
 select no,stname from D.stock;

在您的项目中,您可以通过以下方式查询此视图:

select * from union_of_my_stock_tables;
于 2014-02-28T09:57:33.920 回答