2016 - 2024

感恩一路有你

oracle临时表with oracle with as区别和用法?

浏览量:1502 时间:2021-03-15 07:32:13 作者: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临时表with oracle中with用法 oracle两个时间比较

版权声明:本文内容由互联网用户自发贡献,本站不承担相关法律责任.如有侵权/违法内容,本站将立刻删除。