UPDATE newsreactions
SET newsreactions.enabled = '0'
FROM newsreactions
INNER JOIN users ON newsreactions.memberId = users.id
WHERE users.active = '0' AND users.comment LIKE '%spam%'
出于某种原因,我得到一个语法错误:与内部SQL更新加入,其中
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM newsreactions INNER JOIN users ON newsreactions.memberId = users.id WHERE u' at line 3
不能弄明白虽然。 如果我用select
代替update
和set
,它工作正常。
标签与正在使用的数据库你的问题。 –
MySQL多表UPDATE语句的语法可以在这里找到:http://dev.mysql.com/doc/refman/5.6/en/update.html – spencer7593