SELECT MsThread.ID, MsThread.ThreadName, Count(MsThread.ThreadName) AS TotalPost, ThreadCategory
FROM ( MsThread LEFT JOIN MsPosts ON MsThread.ThreadName = MsPosts.ThreadName )
GROUP BY MsThread.ID, MsThread.ThreadName, MsThread.ThreadCategory;
我已经检查了前面提到方括号的线程,以便加入访问工作,但是我的仍然存在此问题。
最佳答案
尝试这个:
我认为FROM语句中的括号弄乱了事情。
SELECT MsThread.ID, MsThread.ThreadName, Count(MsThread.ThreadName) AS TotalPost, ThreadCategory
FROM MsThread LEFT JOIN MsPosts ON MsThread.ThreadName = MsPosts.ThreadName
GROUP BY MsThread.ID, MsThread.ThreadName, MsThread.ThreadCategory;
或这个。可能正在寻找LEFT“ OUTER” JOIN。
SELECT MsThread.ID, MsThread.ThreadName, Count(MsThread.ThreadName) AS TotalPost, ThreadCategory
FROM MsThread LEFT OUTER JOIN MsPosts ON MsThread.ThreadName = MsPosts.ThreadName
GROUP BY MsThread.ID, MsThread.ThreadName, MsThread.ThreadCategory;