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