久久成人影片av福利在线|国产人成视频在线观看免费|欧洲黄色A级片亚洲一区区|欧美一二三区视频|日本免费的黄色三级片|成人黄色无码网站|亚洲先锋影院A性电影|少妇无玛影片在线看黄片网站|亚洲AV无码成人精品区丝袜|亚洲色情视频在线免费观看

高三網 試題庫 作文庫 大學庫 專業(yè)庫

當前位置: 高三網 > 大學動態(tài) > 正文

with as 用法

2021-07-31 14:17:26文/薛雨彤

WITH AS短語,也叫做子查詢部分(subquery factoring),可以讓你做很多事情,定義一個SQL片斷,該SQL片斷會被整個SQL語句所用到。有的時候,是為了讓SQL語句的可讀性更高些,也有可能是在UNION ALL的不同部分,作為提供數(shù)據(jù)的部分。

with as 用法

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;

推薦閱讀