oracle创建临时表 sql oracle with as区别和用法?
浏览量:1957
时间:2021-03-13 04:20:02
作者:admin
oracle with as区别和用法?
With as 就是将一个子查询的结果作为一张临时表,下面接着写select语句可以通过别名直接使用
语法:
针对一个别名
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
oracle创建临时表 sql sql查询结果作为临时表 sql查询结果生成临时表
版权声明:本文内容由互联网用户自发贡献,本站不承担相关法律责任.如有侵权/违法内容,本站将立刻删除。
下一篇
css文本溢出 es6语法