ciberc Beginner
Joined: 16 Sep 2003 Posts: 3 Topics: 2
|
Posted: Tue Sep 16, 2003 7:17 am Post subject: Updating Rows From Joined Tables |
|
|
I would like to join TBL_A with TBL_B with two common keys between both tables. For all rows from the result set, I would like to update FLD_A of TBL_A with the value of FLD_B on the same table. I was suggested for the SQL below. However, this solution applies only to DB2 V7 and my shop is using V6 (I did try but failed for 'SQLCODE = -104, ERROR: ILLEGAL SYMBOL ","'). Could anyone suggest what can I do?
UPDATE TBL_A
SET FLD_A = FLD_B
WHERE (KEY_A, KEY_B)
IN (SELECT A.KEY_A, A.KEY_B
FROM TBL_A A
,TBL_B B
WHERE A.KEY_A = KEY_A
AND A.KEY_B = B.KEY_B
AND B.KEY_C = 22) |
|