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
子句上抛出错误:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to user near 'ssp_student' WHERE ssp_student.STUDENT_ID = core_student.STUDENT_ID
我只想选择SELECT
中列出的字段,然后加入ssp_student
中ssp_student.STUDENT_ID
字段与core_student.STUDENT_ID
字段相同的所有列。< / p>
答案 0 :(得分:1)
正确的方法是
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;