近期用到mysql关联更新,发现常规的写法如
update A
set A.name = 'string'
from tablea A inner join tableb B on A.id = B.id
where ...
此种写法在mysql下不正确的,mysql的写法如下
update tablea A inner join tableb B on A.id = B.id
set A.name = 'string'
where ...
记录于此,方便日后查阅
阅读(717) | 评论(1) | 转发(0) |