多个表关联update
eg:
UPDATE table1 t1 SET fieldname1 = t2.fieldname1, [fieldname2 = t2.fieldname2]
FROM table2 t2
WHERE t1.Id = t2.Id and t1.Id='2222'
等同:
UPDATE table1 t1 SET (fieldname1,fieldname2) =(
select fieldname1,fieldname2
from FROM table2 t2
where t1.Id = t2.Id
)
WHERE t1.Id='2222'