我的 MySQL 语句有什么问题?
UPDATE table1 SET announcer = ( SELECT memberid
FROM ( table1
JOIN users ON table2.username = table1.announcer
) AS a
WHERE a.username = table1.announcer )
#1064 - 您的 SQL 语法有错误;检查手册 对应你的MySQL服务器 正确使用语法的版本 靠近“某个地方” a.用户名=table1.播音员)' 在第 1 行
UPDATE table1 SET announcer = ( SELECT memberid
FROM ( table1
JOIN users ON table2.username = table1.announcer
) AS a
WHERE a.username = table1.announcer )
#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 'a where
a.username=table1.announcer)'
at line 1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试:
Try:
您还可以在更新中进行加入
注意:出于安全原因(直到您确定的播音员被正确复制),我会创建一个新列,然后说anouncerNew
You can also do the JOIN in the UPDATE
Note: For safty reasons (until your sure announcers get copied over right) I'd instead create a new column, say announcerNew then