SELECT core_student.STUDENT_ID, core_student.FIRST_NAME, core_student.LAST_NAME
FROM `core_student`
INNER_JOIN `ssp_student`
WHERE ssp_student.STUDENT_ID = core_student.STUDENT_ID;
在 WHERE
子句上抛出错误:
您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,了解“ssp_student”附近用户的正确语法,其中 ssp_student.STUDENT_ID = core_student.STUDENT_ID
我只想选择 SELECT
中列出的字段,然后连接 ssp_student
中的所有列,其中 ssp_student.STUDENT_ID
字段是与 core_student.STUDENT_ID
字段相同。
最佳答案
正确的方法是
SELECT core_student.STUDENT_ID, core_student.FIRST_NAME, core_student.LAST_NAME
FROM `core_student`
INNER JOIN `ssp_student`
on ssp_student.STUDENT_ID = core_student.STUDENT_ID;
关于mysql - 这个 MySQL 查询有什么问题? INNER_JOIN WHERE 子句的语法正确吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23065360/