MERGE INTO tb_bsn002m aa
USING
(
SELECT
b.curtr_msno,
a.join_req_no,
b.crtg_rsno,
a.reg_orgnzt_cd,
a.rcter_id,
c.bizer_msno,
b.crtg_induty_cd,
b.curtr_nm,
b.curtr_mbtlno,
b.curtr_brthdy,
b.curtr_sexdstn,
b.curtr_jobtitle_nm,
b.hpage_adres,
b.intrcn,
b.wkday_cnslt_pbtm,
b.wkday_cnslt_petm,
b.sat_cnslt_pbtm,
b.sat_cnslt_petm,
b.sun_hldy_cnslt_pbtm,
b.sun_hldy_cnslt_petm,
b.night_cnslt_pbtm,
b.night_cnslt_petm
FROM tb_svc100m a, tb_svc111d b, tb_svc001m c
WHERE a.join_req_cl = '2'
AND a.join_req_stat = '12'
AND a.dyn = 'N'
AND b.join_req_no = a.join_req_no
AND b.curtr_req_stat = '09'
AND b.dyn = 'N'
AND c.req_no = a.join_req_no
AND c.req_no = b.join_req_no
) bb
ON
(
aa.curtr_msno = bb.curtr_msno
)
WHEN MATCHED THEN
UPDATE SET
aa.crtg_induty_cd = bb.crtg_induty_cd,
aa.curtr_nm = bb.curtr_nm,
aa.curtr_mbtlno = bb.curtr_mbtlno,
aa.curtr_brthdy = bb.curtr_brthdy,
aa.curtr_sexdstn = bb.curtr_sexdstn,
aa.curtr_jobtitle_nm = bb.curtr_jobtitle_nm,
aa.hpage_adres = bb.hpage_adres,
aa.intrcn = bb.intrcn,
aa.wkday_cnslt_pbtm = bb.wkday_cnslt_pbtm,
aa.wkday_cnslt_petm = bb.wkday_cnslt_petm,
aa.sat_cnslt_pbtm = bb.sat_cnslt_pbtm,
aa.sat_cnslt_petm = bb.sat_cnslt_petm,
aa.sun_hldy_cnslt_pbtm = bb.sun_hldy_cnslt_pbtm,
aa.sun_hldy_cnslt_petm= bb.sun_hldy_cnslt_petm,
aa.night_cnslt_pbtm = bb.night_cnslt_pbtm,
aa.night_cnslt_petm = bb.night_cnslt_petm,
aa.curtr_req_stat = '10',
aa.use_yn = 'Y';
'DB(Oracle, Mysql 등)' 카테고리의 다른 글
[오라클] 여러행의 결과를 단일행으로 합치기 (0) | 2017.08.28 |
---|---|
[큐브리드] 다중 컬럼 IN조건 사용방법 (0) | 2016.12.20 |
[Oracle] 테이블 정보 조회 (0) | 2016.03.28 |
[Oracle] 테이블스페이스 용량확인 (0) | 2016.03.28 |
[Oracle] sqlplus 검색결과 파일로 저장하기 (0) | 2016.02.19 |