1. 程式人生 > >oracle中with as 的用法

oracle中with as 的用法

select * from emp;
select * from empinfo;
truncate table empinfo
insert into empinfo
(
empno,
ename,
job,
mgr,
HIREDATE
)
with temp_ as
(
select empno,ename,job,mgr from emp
),
 temp as (  
     select * from emp  
)  
select 
t.empno,
t.ename,
t.job,
t.mgr,
tp.HIREDATE
from temp_ t,temp tp where t.empno=tp.empno;