SqlServer 将一个表中的某些字段更新到另一个表中
方式一:
UPDATE A
SET A1 = B1, A2 = B2, A3 = B3
FROM A LEFT JOIN B ON A.ID = B.ID
方式二:
UPDATE A
SET A1 = B1, A2 = B2, A3 = B3
FROM A, B WHERE A.ID = B.ID
本文是原创文章,采用CC BY-NC-SA 4.0协议,完整转载请注明来自耕田日记
评论
方式一:
UPDATE A
SET A1 = B1, A2 = B2, A3 = B3
FROM A LEFT JOIN B ON A.ID = B.ID
方式二:
UPDATE A
SET A1 = B1, A2 = B2, A3 = B3
FROM A, B WHERE A.ID = B.ID