I have query which like to count the number of post in each thread. Now I faced some problem. If my new thread which don't have the post id it will not display out the thread. May I know how can I fix it? Here is my query
SELECT t.title, m.userName, COUNT(p.postID) AS Expr1, t.threadID
FROM post p ,thread t , person m WHERE m.PersonID = t.PersonID
AND t.threadID = p.threadID AND t.categories = "Announcement"
GROUP BY t.title, m.PersonName
I hope i will get the result like
-------------------------------------------------
| Title | Author | Replies|
-------------------------------------------------
| Hello | haah | 7 |
------------------------------------------------
| Bye Bye | lee | 8 |
------------------------------------------------
The replies is based on the replies of thread.
LEFT JOIN