创建Oracle 临时表,可以有两种类型的临时表:
会话级的临时表
事务级的临时表 。
--临时表结构和asset一样,默认是On Commit Delete Rows
create GLOBAL temporary table temp_t1
as
select * from asset where rownum<2 ;
--Commit 后记录依然保持
create GLOBAL temporary table temp_t2 On Commit Preserve Rows
as
select * from asset where rownum<2 ;
--Commit 后删除记录
create GLOBAL temporary table temp_t3 On Commit Delete Rows
as
select * from asset where rownum<2 ;