SQL多表关联更新

T-SQL

//方法1

UPDATE
UIT SET UIT.InnerID = UAT.InnerID FROM UserMgr_UserAccount_SchoolLeader AS UAT INNER JOIN UserMgr_UserInfo_SchoolLeader AS UIT
ON UAT.UserID = UIT.UserID

 

//方法2

UPDATE UIT
SET UIT.InnerID = UAT.InnerID
FROM UserMgr_UserAccount_SchoolLeader AS UAT,UserMgr_UserInfo_SchoolLeader AS UIT
WHERE UAT.UserID = UIT.UserID

 

posted @ 2020-03-31 20:21  雄介  阅读(164)  评论(0编辑  收藏  举报