2011년 10월 11일 화요일

JOIN문을 이용한 UPDATE 쿼리


UPDATE T1
SET T1.P_CODE_VALUE1 = T2.P_CODE1
,T1.P_CODE_VALUE2 = T2.P_CODE2
FROM TMAST02TT T1
INNER JOIN TCODE02TT T2 ON T1.YEAR = T2.YEAR AND T1.P_CODE = T2.T_CODE
WHERE 1=1
AND T1.GUBUN = :gubun AND T1.YEAR = :year AND T1.SEASON = :season AND T1.SCHOOL = :school 
AND T1.BOKJONG = :bokjong AND T1.PUMOK = :pumok AND T1.SAYANG = :sayang AND T1.P_CODE = :pCode
AND T2.SEQ = :seq

댓글 없음:

댓글 쓰기