0

I am trying to update a table. How can i use a join on the Base table where i am going to update. I want to apply join to the base table and restrict the data.

UPDATE MY_TABLE T,SUPPORTING_TABLE S T.COL1 = S.COL1 SET T.COL2 = (SELECT COL FROM MY_TABLE)

Thanks in Advance

1 Answers1

0

you could try something like this modify according to your use. you can also add WHERE clause to inner query if you want:

UPDATE 
    (SELECT t.COL1 as OLD, s.COL1 as NEW
     FROM MY_TABLE t
     INNER JOIN SUPPORTING_TABLE s
     ON t.COL1  = s.COL1 ) data
 SET data.OLD = data.NEW
Paras
  • 240
  • 1
  • 13