#1064 - 您的SQL语法有错误;查看与您的MySQL服务器版本对应的手册,以便在附近使用正确的语法

时间:2013-06-10 07:28:23

标签: sql phpmyadmin

SELECT student.studnt_id,student_onfo.student_name,subject,marks  
FROM `student` 
INNER JOIN 'student_info' ON student.studnt_id=student_info.studnt_id 
ORDER BY student.studnt_id

当我触发此查询时,它显示此错误

2 个答案:

答案 0 :(得分:3)

SELECT student.studnt_id,student_info.student_name,subject,marks  
FROM `student` 
INNER JOIN `student_info` ON student.studnt_id=student_info.studnt_id 
ORDER BY student.studnt_id

试试这个查询。

你有拼写错误: -

student_onfo.student_name - > student_info.student_name

'student_info' - > student_info

答案 1 :(得分:1)

试试这个 -

SELECT 
      s.studnt_id
    , si.student_name
    , subject
    , marks  
FROM student AS s
JOIN student_info AS si ON s.studnt_id = si.studnt_id 
ORDER BY s.studnt_id