CreateTime--2018年1月4日16:38:01
Author:Marydon
oracle 查询本周数据生成下周数据
第一步:查询指定区间数据
第二步:改变查询结果的值
查询日期字段+7
第三步:将查询结果插入到表中
INSERT INTO CONSULT_SCHEDULE
(ORG_ID,
DEPENT_ID,
DEPENT_NAME,
DOCTOR_ID,
DOCTOR_NAME,
DOCTOR_PHONE,
SCHEDULE_DATE,
WEEK_TXT,
WB_TYPE,
CLOSE_TZ,
REPLACE_TZ)
(SELECT T2.ORG_ID,
T2.DEPENT_ID,
T2.DEPENT_NAME,
T2.DOCTOR_ID,
T2.DOCTOR_NAME,
T2.DOCTOR_PHONE,
(T2.SCHEDULE_DATE + 7) SCHEDULE_DATE,
T2.WEEK_TXT,
T2.WB_TYPE,
T2.CLOSE_TZ,
T2.REPLACE_TZ
FROM CONSULT_SCHEDULE T2
WHERE T2.SCHEDULE_DATE BETWEEN TO_DATE('2017-12-18', 'yyyy-MM-dd') AND
TO_DATE('2017-12-24', 'yyyy-MM-dd'));
效果展示: