0
你能發現這個查詢有什麼問題嗎?MySQL:使用Join時出現Syntaxerror?
SELECT * FROM requests
WHERE id = '".$id."'
LEFT JOIN request_data ON (requests.id = request_data.request_id)
GROUP BY requests.id
一直在工作它一段時間,但似乎無法得到它的權利!
數據庫看起來是這樣的:
-requests
-id
-another column
-and a third one
-request_data
-request_id
-key
-value
編輯:哦,對了,和錯誤:
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 'LEFT JOIN request_data ON (requests.id = request_data.request_id) GROUP BY ' at line 3
任何想法?
請解釋此查詢意味着要做什麼。爲什麼你有'WHERE id ='「。$ id。」''和'GROUP BY requests.id'? –