Update the value of more than 2 fields at the same time

method one:

MERGE INTO GDYLSY_T.AC82 A

USING (SELECT * FROM ICD8_YH) E

ON (A.ICD8_AAZ220 = E.AAZ220)

WHEN MATCHED THEN

  UPDATE SET A.BAE118 = E.BAE118, A.AAE010 = E.AAE010;

 

Method two:

update table1 a set (a.col1,a.col2)=(select col1,col2 from table2 b where b.id=a.id);

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326115992&siteId=291194637