MySQL
update tablea a, tableb b set a.bname=b.name where a.bid=b.id and a.id between 262 and 271 update tablea a inner join tableb b on a.bid=b.id set a.bname=b.name where a.id between 262 and 271 --between 是>= and <=,即包含两个边界 --有查询的 update a set a.num = a.num + b.num from table1 a inner join (select * from b1) b on a.id = b.id --(关联条件) where ... update mf_bus p,( select pact_no,pact_amt,sum(putout_amt) as putout_amt from mf_app group by pact_no ) b set p.usable_finc_amt = b.pact_amt - b.putout_amt where p.pact_no = b.pact_no
Oracle/DB2
UPDATE A a SET (a.A1, a.A2, a.A3) = ( SELECT b.B1, b.B2, b.B3 FROM B b WHERE a.ID = b.ID ) WHERE a.ID IN (SELECT B.ID FROM B WHERE A.ID = B.ID)