有这三个表:
- 帖子
- post_replies
- 喜欢
这个查询正在返回我的帖子,他们的回复都很好。
SELECT posts.title, posts.num, posts.status, posts.category, posts.content, posts.member_num, COUNT( posts_replies.blyrb_num ) AS count, COUNT( likes.comment_num ) AS likes_count
FROM posts_replies
INNER JOIN posts ON ( posts_replies.blyrb_num = posts.num )
LEFT JOIN likes ON ( likes.comment_num = posts_replies.num )
WHERE posts.status <>3
AND posts.access = 'Public'
AND (
posts.title LIKE '%dress%'
OR posts.content LIKE '%dress%'
)
GROUP BY posts.num
但问题是这个查询只返回有一些回复的帖子。我不想要这样的限制,我想要所有的帖子,不管他们有没有回复。
关于我在这里做错了什么的任何想法?
谢谢