1. 程式人生 > >oracle update select (更新查詢的sql)

oracle update select (更新查詢的sql)

(1).update   tableName   set   (a,b,c)=(select   a,b,c   from   ida   where   ida.id=tableName.id);

(2).update   tableName t1   set   a=(select   t2.a   from   ida   t2   where   t1.id=t2.id),b=(select   t2.b   from   ida   t2   where   t1.id=t2.id),c=(select   t2.c   from   ida   t2   where   t1.id=t2.id)

(3) 每條資料執行為:UPDATEtableName SET (A,B,C)=(select A,B,C from tableName where id=''xxxxxx)  WHERE id='xxxxxxx'