简体   繁体   English

IBM i UNION *此处使用全部

[英]IBM i UNION *ALL used here

I have this in CL and would like to make it into a view. 我在CL中拥有此功能,并希望将其纳入视图。 I first run 2 queries which are creating these 2 tables. 我首先运行2个查询,这些查询正在创建这2个表。 How would the code here for the UNION ALL be? UNION ALL的代码如何? the 2 tables are (Logical) views 这两个表是(逻辑)视图

CPYF       FROMFILE(JETDTA/EODDETAILH) +                 
              TOFILE(JETDTA/EODDETAILS) MBROPT(*ADD) +    
              FMTOPT(*NOCHK)                                
              MONMSG CPF0000              

Besides the structure of the queries result must match, you can do it with: 除了查询结果的结构必须匹配之外,您还可以使用以下方法:

CREATE VIEW yourViewName AS 
SELECT *
FROM JETDTA.EODDETAILH
UNION
SELECT *
FROM JETDTA.EODDETAILS

You can find more information about the CREATE VIEW command here and about the UNION clause here , both of those are part of SQL/400. 您可以找到有关CREATE VIEW命令的详细信息, 在这里和有关UNION子句在这里 ,这两个都是SQL / 400的一部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM