日期:2014-05-17 浏览次数:20558 次
UPDATE table1 t1 SET a=(SELECT aFROM table2 t2 WHERE t1.id=t2.reqid),
b=(SELECT b FROM table2 t2 WHERE t1.id=t2.reqid),
c=(SELECT c FROM table2 t2 WHERE t1.id=t2.reqid) WHERE t1.id IN (SELECT reqid FROM table2);
UPDATE t1
SET a=t2.a,b=t2.b,c=t2.c
from table1 t1
inner join table2 t2 on t1.id=t2.reqid
update table1
set a = table2.a,
b = table2.b,
c = table2.c
from table2
where table2.reqid= table1.id