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
原文:http://www.cnblogs.com/Early-Bird/p/7883391.html