我如何通过一个查询获得以下信息:我想从我的评论表中获得所有对给定 post_id 进行评论的人,然后根据用户的姓名检查用户评论了多少次。我想避免对它进行 2 个不同的查询
我一直在尝试以下但不会返回预期结果
SELECT comments.*, COUNT(approved.comment_approved) AS has_commented FROM wp_comments AS comments
INNER JOIN wp_comments AS approved
ON comments.comment_author = approved.comment_author
WHERE comments.comment_post_ID =14616
GROUP BY comments.comment_content