Home >Database >Mysql Tutorial >oracle数据库 多张表记录连接union

oracle数据库 多张表记录连接union

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 18:01:041365browse

CREATE OR REPLACE VIEW UIA.VIEW_UIA_USER AS ( SELECT t1.ID,t1. USER_NAME ,t1.USER_PASS,t1.USER_IDCARD,t1.USER_ALIAS,t1.USER_EMAIL,t1.USER_STUDENTID,t1.USER_WORKERID,t1.USER_TYPE,t1.USER_PHONENUMBER,t1.USER_STATUS, uia_user fromtab FROM uia

CREATE OR REPLACE VIEW UIA.VIEW_UIA_USER AS
(SELECT t1."ID",t1."USER_NAME",t1."USER_PASS",t1."USER_IDCARD",t1."USER_ALIAS",t1."USER_EMAIL",t1."USER_STUDENTID",t1."USER_WORKERID",t1."USER_TYPE",t1."USER_PHONENUMBER",t1."USER_STATUS",'uia_user' fromtab FROM uia.uia_user t1
UNION
SELECT t2."ID",t2."USER_NAME",t2."USER_PASS",t2."USER_IDCARD",t2."USER_ALIAS",t2."USER_EMAIL",t2."USER_STUDENTID",t2."USER_WORKERID",t2."USER_TYPE",t2."USER_PHONENUMBER",t2."USER_STATUS",'uia_user_TEMP' fromtab FROM uia.uia_user_temp  t2);

fromtab 字段是静态值

UNION   连接

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn