with cur_month as
公司主营业务:做网站、成都网站设计、移动网站开发等业务。帮助企业客户真正实现互联网宣传,提高企业的竞争能力。创新互联是一支青春激扬、勤奋敬业、活力青春激扬、勤奋敬业、活力澎湃、和谐高效的团队。公司秉承以“开放、自由、严谨、自律”为核心的企业文化,感谢他们对我们的高要求,感谢他们从不同领域给我们带来的挑战,让我们激情的团队有机会用头脑与智慧不断的给客户带来惊喜。创新互联推出东兰免费做网站回馈大家。
(select *
from CUST_SFM_JYCRMEPC_LIST
where mold = '302'
and create_time >=
to_date(to_char(sysdate, 'yyyy/mm') || '/01', 'yyyy-mm-dd')
and create_time <
to_date(to_char(last_day(sysdate), 'yyyy/mm/dd'), 'yyyy-mm-dd') + 1),
pre_month as
(select *
from CUST_SFM_JYCRMEPC_LIST
where mold = '302'
and create_time >=
to_date(to_char(ADD_MONTHS(sysdate, -1), 'yyyy/mm') || '/01',
'yyyy-mm-dd')
and create_time <
to_date(to_char(last_day(ADD_MONTHS(sysdate, -1)), 'yyyy/mm/dd'),
'yyyy-mm-dd') + 1)
insert /*+append parallel(t,4)*/ --月新增
into CUST_SFM_JYCRMEPC_LIST t
select PROVICE_CODE,
MDN,
IMSI,
PAYMENT_MODE_CD,
PROD_INST_STATE,
STATE_TIME,
REGION,
EMDN,
EIMSI,
EPAYMENT_MODE_CD,
EPROD_INST_STATE,
ESTATE_TIME,
EREGION,
302B mold,
sysdate CREATE_TIME
from (select PROVICE_CODE,
MDN,
IMSI,
PAYMENT_MODE_CD,
PROD_INST_STATE,
STATE_TIME,
REGION,
EMDN,
EIMSI,
EPAYMENT_MODE_CD,
EPROD_INST_STATE,
ESTATE_TIME,
EREGION
from cur_month
minus
select PROVICE_CODE,
MDN,
IMSI,
PAYMENT_MODE_CD,
PROD_INST_STATE,
STATE_TIME,
REGION,
EMDN,
EIMSI,
EPAYMENT_MODE_CD,
EPROD_INST_STATE,
ESTATE_TIME,
EREGION
from pre_month)
CUST_SFM_JYCRMEPC_LIST 该表示组合分区表,以CREATE_TIME
为主分区, mold 为子分区,我要实现的业务是,用 CUST_SFM_JYCRMEPC_LIST表中本月的减去上月的,求出新增的,然后将新增的插入到 CUST_SFM_JYCRMEPC_LIST 表, 请教一下有什么比较好的方法不用写的这么累呢