我有三個表A B C,我試圖從所有三個檢索信息。MYSQL查詢使用左連接和where IN子句
A具有columnns userid頭像用戶名,B具有列postid,dateshared和C具有列註釋postid datecommented。
我試圖運行查詢
Select C.comment, C.commenter, C.datecommented, B.postid, B.dateshared A.username A.avatar from B Left Join C Left join A on C.postid = B.postid AND A.userid = C.commenter where B.postid IN ('1','2','3') order by C.dateshared desc
,但它提供了以下錯誤:
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 'where B.postid IN ('1', '2', '3') order by C.dateshared '
任何人都可以指出我在做什麼錯誤或建議如何去做?
工作就像曾爲以及魅力 –