一条update语句只能update一个表update b set bf11=a.af11 from a,b where a.af10=b.bf10 and a.af11<>b.bf11update b set bf21=a.af21 from a,b where a.af20=b.bf20 and a.af21<>b.bf21
是不是如下: update b set bf11 = (case when a.af10 = b.bf10 and a.af11 <> b.bf11 then a.af11 else bf11 end),bf21 = (case when a.af20 = b.bf20 and a.af21 <> b.bf21 then a.af21 else bf21 end) from a,b where a.af10 = b.bf10 or a.af20 = b.bf20
update b set bf11=a.af11 from a,b where a.af10=b.bf10 and a.af11<>b.bf11update b set bf21=a.af21 from a,b where a.af20=b.bf20 and a.af21<>b.bf21
update D2..b set Af11=tem.bf11 from d1.a tem where tem.af10=D2..b.bf10 and tem.af11<>D2..b.bf11update D2..b set Af21=tem.bf21 from d1.a tem where tem.af20=D2..b.bf20 and tem.af21<>D2..b.bf21
update D2..b set Af11=tem.bf11 from d1.a tem where tem.af10=D2..b.bf10 and tem.af11<>D2..b.bf11update D2..b set Af21=tem.bf21 from d1.a tem where tem.af20=D2..b.bf20 and tem.af21<>D2..b.bf21
update b set bf11=a.af11 from a,b where a.af10=b.bf10 and a.af11<>b.bf11update b set bf21=a.af21 from a,b where a.af20=b.bf20 and a.af21<>b.bf21
update D2..b set Af11=tem.bf11 from d1.a tem where tem.af10=D2..b.bf10 and tem.af11<>D2..b.bf11update D2..b set Af21=tem.bf21 from d1.a tem where tem.af20=D2..b.bf20 and tem.af21<>D2..b.bf21
update d2..b set bf11=aa.af11 from d1..a as aa where aa.af10=d2..b.bf10 and aa.af11<>d2..b.bf11update d2..b set bf21=aa.af21 from d1..a as aa where aa.af20=d2..b.bf20 and aa.af21<>d2..b.bf21
update d2..b set bf11=aa.af11 from d1..a as aa where aa.af10=d2..b.bf10 and aa.af11<>d2..b.bf11update d2..b set bf21=aa.af21 from d1..a as aa where aa.af20=d2..b.bf20 and aa.af21<>d2..b.bf21
update b set bf11 = (case when a.af10 = b.bf10 and a.af11 <> b.bf11 then a.af11 else bf11 end),bf21 = (case when a.af20 = b.bf20 and a.af21 <> b.bf21 then a.af21 else bf21 end)
from a,b where a.af10 = b.bf10 or a.af20 = b.bf20