2014-09-29 24 views
0

这在Mssql中是完美的。如何在Oracle中创建临时表+工会

如何在Oracle改写这个:

create table #temptable (mgr bigint) 
insert into #temptable (mgr) ( 
select 1 
union select 2 
union select 3) 
+0

你这是什么想要达到?你知道临时表中的数据只保留到会话结束或有提交/回滚(它取决于临时表的类型)吗? – zaratustra 2014-09-29 13:24:35

回答

0

您可以创建一个临时表是这样的:

create global temporary table temptable (mgr number); 

,将数据插入该表:

insert into temptable 
select 1 from dual union all 
select 2 from dual union all 
select 3 from dual;