oracle中创建视图并查询视图

前端之家收集整理的这篇文章主要介绍了oracle中创建视图并查询视图前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1.创建视图:

CREATE OR REPLACE VIEW TB_CONF AS
SELECT SI.SYSID id,SI.SYS_NAME_EN AS sysName,SI.SYS_NAME_CN AS sysCname,SI.RECEIVE_STATUS AS sysReceiveStatus,
SI.SEND_STATUS AS sysSendStatus,SI.ENCODING AS encoding,
(SELECT SIXSD.VALIDTYPE
FROM TB_SUB_SYS_XSD SIXSD
WHERE SIXSD.SYSID = SI.SYSID) AS xsdValidType,
(SELECT SIXSD.CONTENT
FROM TB_SUB_SYS_XSD SIXSD
WHERE SIXSD.SYSID = SI.SYSID) AS xsdContent
FROM TB_SUB_SYS_CONF SI
WHERE SI.DEL_FLAG = 0

2.查询视图:

SELECT * FROM TB_CONF

查询视图就和查询表一样,只不过是把表名改为视图名就可以了。。

猜你在找的Oracle相关文章