SELECT posts.id AS post_id, categories.id AS category_id, title, contents, posts.date_posted, categories.name, comments.id AS comment_id
FROM posts
LEFT JOIN (categories, comments) ON categories.id = posts.cat_id AND posts.id = comments.post_id
WHERE posts.id = 28
我希望此SQL查询选择所有帖子,而不仅仅是那些有注释的帖子,但此时此查询返回那些也有意见的行。三个表中的SQL查询选择