| 发表于:2007-09-05 13:37:493楼 得分:0 |
楼主没必要用insert,太慢,教你一招: 1.备份三个月前的数据 create table table_backup as select * from table where adddate <to_date( '2007-06-01 ', 'yyyy-mm-dd ') "; 2.将需要保留的数据保存到临时表 create table table_temp as select * from table where adddate> =to_date( '2007-06-01 ', 'yyyy-mm-dd ') "; 3.清空正式表(注意一定要做好备份,否则用truncate不可回滚) truncate table table_name; 4.将临时表数据导入 insert into table_name select * from table_temp; 以上是大数据量的做法,楼主参考一下。 我的博客: http://blog.csdn.net/kinglht | | |
|