复制表结构:create table t1 like petition_basic_info;
赋值表数据:
insert into tablea(col1,col2) select col1,col2 from tablea where col1=xx,col2=yy
删除表数据:delete t1;
删除表:drop table t1;
--------------------------------------------------------------
详细参考文章 : http://gong-10140.iteye.com/blog/1593660
总是提示表的记录长度太长,此语句或有帮助
db2 list tablespaces show detail
第一步:先创建临时表空间:
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(学号);