數據庫同時更新多個字段

oracle :

update T1 t1
   set ( t1.a,t1.b) = (select t2.a, t2.b  from  T2 t2);


sql:

update T1 t1 set
   t1.a = t2.a,t1.b=t2.b,t1.c=t2.c
from T1 t11,T2 t2
where (t11.條件1) and (t2.條件2)  

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章