posted by 구름너머 2009. 10. 23. 11:05

블로그: http://blog.naver.com/orapybubu?Redirect=Log&logNo=40048824725

A table 과 b table 를 조인하여 A table의 특정필드에 b table의 특정 필드의 값을 Update 할경우

update /*+ bypass_ujvc */
( SELECT a.colnm ra , b.colnm rb
FROM a, b
WHERE a.key= b.key
) set ra = rb;


ALTER SESSION ENABLE PARALLEL DML;
UPDATE (SELECT /*+ BYPASS_UJVC FULL(A) PARALLEL(A 4) FULL(B) PARALLEL(B 4) */
A.MOVE_TYPE, B.GUBUN
FROM TB_BCDBETCNOR PARTITION (P20090918) A, TB_BCDANUMBERMOVE B
WHERE B.APPLY_MONTH = '200909'
AND A.ROOTID IN ('BFK','BKL','BKR','BKT','BKV','BLK','BMK','BSL','BST','BTK','BVK','DKL','IKL',
'ILK','LKL','LKT','LLK','LTK','TKL','TKR','TKT','TKV','TLK','TMK','TST','TTK','TVK')
AND A.CLD_A_NO || A.CLD_K_NO || A.CLD_S_NO = B.RCP_SVC_NO
AND A.CALL_START_DATE BETWEEN B.START_DATE AND B.END_DATE
)
SET A.MOVE_TYPE = B.GUBUN;