专为高三考生提供有价值的资讯

当前位置:黑边网大学介绍大学动态with as 用法

with as 用法

时间:2021-07-31作者:鸥迹一键复制全文保存为WORD
专题:with用法

WITH AS短语,也叫做子查询部分(subquery factoring),可以让你做很多事情,定义一个SQL片断,该SQL片断会被整个SQL语句所用到。有的时候,是为了让SQL语句的可读性更高些,也有可能是在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 用法

将本文的Word文档下载到电脑,方便收藏和打印
推荐度:
点击下载文档文档为doc格式

小编推荐

1.atonin的用法及区别口诀

2.while循环的用法举例

3.python中insert()函数的用法

4.content的用法及搭配

5.typedef struct 用法

6.python中float的用法

7.private在java中的用法

8.to have done用法

相关文章

Copyright 2019-2029 https://www.heibian.com 【黑边网】 皖ICP备19022700号-4

声明: 本站 所有软件和文章来自互联网 如有异议 请与本站联系 本站为非赢利性网站 不接受任何赞助和广告