我有三個表,我試圖加入使用this問題中的示例。但是我得到的錯誤。內連接3表
錯誤:
#1054 - Unknown column 'referrer.Referrer_Name' in 'field list'
代碼:
SELECT pupils.Pupils_Surname,
pupils.Pupils_FirstName,
referrer.Referrer_Name,
progress_track.test_1,
progress_track.test_2,
progress_track.test_3,
progress_track.test_4,
progress_track.test_5,
progress_track.test_6,
progress_track.test_7,
progress_track.test_8,
progress_track.test_9,
progress_track.test_10
FROM pupils
INNER JOIN progress_track ON progress_track.Progress_Report_Pupils_ID=pupils.Pupils_ID;
INNER JOIN referrer ON pupils.Pupils_Referrer, referrer.Referrer_ID ;
請張貼相關的表'創建表code' – 1000111
有一個分號後的第一個內連接。因此,您的查詢錯過了這一行('INNER JOIN referrer ON pupils.Pupils_Referrer,referrer.Referrer_ID;') – 1000111
請確保「referrer」表中的列名稱:Referrer_Name是否存在。我必須刪除第一個內部聯接參考的分號。 –