有时 update 更新语句会需要根据另一个表进行更新,举例如下:
-- 方式一:
update tableA a, tableB b set a.Name=b.Name, a.Age=b.Age where a.IDCard=b.IDCard;
-- 方式二:
update tableA a inner join tableB b on a.IDCard=b.IDCard set a.Name=b.Name, a.Age=b.Age;
有时 update 更新语句会需要根据另一个表进行更新,举例如下:
-- 方式一:
update tableA a, tableB b set a.Name=b.Name, a.Age=b.Age where a.IDCard=b.IDCard;
-- 方式二:
update tableA a inner join tableB b on a.IDCard=b.IDCard set a.Name=b.Name, a.Age=b.Age;