我真的不明白会发生什么。 我有两个表reponses_vitesse和questions_vitesse,我尝试对它们进行内部联接。 哦,当然我的桌子有很好的领域。 但无论我尝试什么,我都会在下面看到1054错误......而ID行当然存在于我的表格中......
如果我写 SELECT ID,QUESTION.reponses_vitesse,....等...... 然后我得到了[Err] 1054 - 未知专栏' QUESTION.reponses_vitesse'在'字段列表'
我使用mysql 5.5.24
非常感谢任何帮助。
谢谢。
[SQL]
SELECT ID.reponses_vitesse, QUESTION.reponses_vitesse, REPONSE.reponses_vitesse,VALEUR_CONTESTATION.reponses_vitesse, SESSION_ID,
NOM_QUESTION.questions_vitesse, TEXTE_QUESTION.questions_vitesse, OBLIGATOIRE.questions_vitesse
FROM reponses_vitesse
INNER JOIN questions_vitesse ON QUESTION.reponses_vitesse = QUESTION.questions_vitesse`
WHERE SESSION_ID.reponses_vitesse = 'apbt8p7g64g44jdc5o2bpp4t13'
GROUP BY ID.reponses_vitesse
ORDER BY ID.reponses_vitesse ASC
[Err] 1054 - 未知栏' ID.reponses_vitesse'在'字段列表'
答案 0 :(得分:0)
查看您的查询的这一行:
INNER JOIN questions_vitesse ON QUESTION.reponses_vitesse = QUESTION.questions_vitesse`
最后有一个尾随的字符。但没有开放。
答案 1 :(得分:0)
错误的具体原因是您错误地格式化了表/字段引用。而不是" field.table",它应该是" table.field"。您收到的错误只发生在select语句的第一个字段上,因为MYSQL无法识别名为" ID"查询中的任何位置。您首先需要撤消所有引用。
看起来应该是这样的:
SELECT reponses_vitesse.ID, reponses_vitesse.QUESTION,reponses_vitesse.RESPONSE,reponses_vitesse.VALEUR_CONTESTATION, SESSION_ID, questions_vitesse.NOM_QUESTION, questions_vitesse.TEXTE_QUESTION, questions_vitesse.OBLIGATOIRE
FROM reponses_vitesse
INNER JOIN questions_vitesse ON reponses_vitesse.QUESTION = questions_vitesse.QUESTION
WHERE reponses_vitesse.SESSION_ID = 'apbt8p7g64g44jdc5o2bpp4t13'
GROUP BY reponses_vitesse.ID
ORDER BY reponses_vitesse.ID ASC