第一步:先创建临时表空间:
create user temporary tablespace test
pagesize 4 k managed by system
using ('[curdir]\temp');
第二步:创建临时表:
declare global temporary table t1
like student
on commit preserve rows not logged in test;
如果不加上 on commit preserve rows 当insert临时表提交之后临时表里的数据会自动删除掉
第三步:插入数据
insert into session.t1
select * from student
第四步:查询数据
select * from session.t1 where 学号 = 081103;
第五步:创建索引,提高速度
create index session.t1index on session.t1(学号);