ORACLE数据库,数据量大,转移数据到备份表语句

INSERT INTO TEMP_BUS_TRAVEL_INFO 
( SELECT * FROM BUS_TRAVEL_INFO t where to_Char( start_time,'YYYYMMDD')>='20170101' AND to_Char( start_time,'YYYYMMDD')<='20170601')

SELECT COUNT(*) FROM TEMP_BUS_TRAVEL_INFO

 

 日期过滤范围把查询出来的结果直接插入到新表中。然后删除。

INSERT INTO TEMP_BUS_TRAVEL_INFO 
( DELETE  BUS_TRAVEL_INFO t where to_Char( start_time,'YYYYMMDD')>='20170101' AND to_Char( start_time,'YYYYMMDD')<='20170601')

SELECT COUNT(*) FROM TEMP_BUS_TRAVEL_INFO

 

posted @ 2017-11-23 10:00  歌·颂  阅读(1624)  评论(0编辑  收藏  举报