這裏是複雜的查詢,我寫的,但不能弄清楚什麼問題:MySQL的語法錯誤對於複雜查詢
SELECT student.progid,
student.batch
FROM (student
JOIN registers
ON student.studentid = registers.studentid)
JOIN (SELECT offers.courseno
FROM (offers
JOIN instructor
ON offers.instructorid = instructor.instructorid))
ON offers.courseno = registers.courseno
WHERE instructor.instructorname = 'P M Jaat'
AND (offers.acadyear LIKE '2007%'
OR offers.acadyear LIKE '2008%'
OR offers.acadyear LIKE '2009%'
OR offers.acadyear LIKE '2010%'
OR offers.acadyear LIKE '2011%');
這將導致一個錯誤,但我會離開它別人告訴你這是什麼:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near 'R1
JOIN (SELECT
你能告訴我們您所看到的語法錯誤? –
'FROM(student ...'是否正確? – Kisaragi
學生是表名,是正確的。 –