批量联表更新

在批量联表更新得写法上,mssql和mysql是不一样的。

mssql的写法是在from环节关联多表,而mysql是在update环节关联多表。

mssql写法:

update studenttmp
set t.`Name`=s.`Name`
from studenttmp t left join student s on s.Id=t.Id
where s.`Name`='qqq'

mysql写法:

update studenttmp t left join student s on s.Id=t.Id
set t.`Name`=s.`Name`
where s.`Name`='qqq'
原文地址:https://www.cnblogs.com/williamwsj/p/10114766.html