SQL 查询虽然构造正确,但返回 1064 错误
有人可以指出为什么以下查询失败吗?
SELECT
references_translations.language_id,
references_translations.active,
references_translations.title,
references_translations.slug,
references_translations.body,
references_translations.seo_title,
references_translations.seo_description,
references.*
FROM (references)
INNER JOIN references_translations ON references_translations.reference_id = references.id AND references_translations.language_id = 'nl'
WHERE `references_translations`.`active` = 1;
我不明白为什么这个查询总是失败。无法找到我的表名或列名是否被 MySQL 保留。
任何正确方向的指示将不胜感激。提前致谢。
Can somebody point out why the following query fails?
SELECT
references_translations.language_id,
references_translations.active,
references_translations.title,
references_translations.slug,
references_translations.body,
references_translations.seo_title,
references_translations.seo_description,
references.*
FROM (references)
INNER JOIN references_translations ON references_translations.reference_id = references.id AND references_translations.language_id = 'nl'
WHERE `references_translations`.`active` = 1;
I cant see why this query keeps failing. Couldn't find if any of my table or column names are reserved by MySQL.
Any pointers in the right direction would be greatly appreciated. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
references
是一个保留关键字,请尝试将其括在反引号 ` 中。references
is a reserved keyword, try to enclose it in backticks `.参考文献是一个保留字。
从下面的链接检查:
MySQL 5.5 保留字
References is a Reserve word.
Checked from link below:
MySQL 5.5 Reserved-words