【发布时间】:2023-02-25 17:27:07
【问题描述】:
我正在使用 mysql,但我混淆了“And”、“Where” Somby dy 可以告诉我这些之间有什么区别。
SELECT *,COUNT(comment.id) as comment_count from posts LEFT JOIN comment on posts.post_id =comment.post_id AND comment.approve = 1 GROUP BY posts.post_id
SELECT *,COUNT(comment.id) as comment_count from posts LEFT JOIN comment on posts.post_id =comment.post_id WHERE comment.approve = 1 GROUP BY posts.post_id
【问题讨论】:
-
不要破坏你的问题。
标签: mysql