当前位置:首页 > 大型 > with as 用法

with as 用法

考周网头像
创始人 考周网
2023-11-27 20:51 阅读 正文:
with as 用法 with as 用法

WITH 6日活 AS短语,也叫做子查询部分到物(subquery factoring),可以侣结让你做很多事情,定义一个洲节SQL片断,该SQL片断会被整个SQL语句视什所用到。有海姑的时候,是为了让S堂 QL语句的可读性更高些,也有可能是图明在UNION ALL的不同部分,作为提供数据捧腹的部分。

with as 用法

–针对一个别名

with tmp as (select * from tb_name)

–针对多个别名

with

tmp as (select * from tb_name),

tmp2 as (select * from tb_name2),

tmp3 as (select * from tb_name3),

–相当于建了个e临时表

with e as (select * from scott.emp e where e.empno=7499)

select * from e;

–相当于建了e、d临时表

with

e as (select * from scott.emp),

d as (select * from scott.dept)

select * from e, d where e.deptno = d.deptno;

热门关键词:   with as 用法   
预约考周网考试资讯添加微信号:yuegsz 了解更多考试知识
© 著作权归作者所有
上一篇:2023潍坊理工学院学费 各专业每年多少钱 下一篇:没有了
考周网简介
考周网创始人
全国各地考试资讯,各个行业考试新闻满足您的需求。
考周网一个专注考试信息分享的平台,汇聚国内外最新资讯,提供计算机考试/外语考试/资格考试/学历考试/会计考试/工程考试/医学考试专升本考试类等56种考试信息及培训服务,了解考试信息就找考周网!