我有三个表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 '
任何人都可以指出我在做什么错误或建议如何去做?
工作就像曾为以及魅力 –