用表B的数据(B1列,B2)更新表A的A1,A2列
SQL Server:
update A SET A.A1 = b.B1,A.A2=B.A2 FROM A ,B WHERE A.ID1 = B.ID1 and A.ID2 = B.ID2;
Access:
update A, B set A.A1 = B.B1,A.A2=B.B2 where A.ID1 = B.ID1 and A.ID2 = B.ID2;
--或
update A INNER JOIN B ON A.ID1 = B.ID1 AND A.ID2= B.ID2 SET A.A1 = B.B1,A.A2=B.B2;
原文地址:https://blog.51cto.com/alun51cto/2392062
时间: 2024-10-14 08:59:18