近期用到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 ...
记录于此,方便日后查阅
784阅读 1评论2011-12-02 桔色花花朵
分类:
<img src="/image/face/6.gif" >