MYSQL get all grouped results one one query with a row count
问题 So I have searched everywhere for this but I can't find this specific relation. The query below returns all posts from a user and the number of people who liked the post because I used a GROUP BY postid meaning that if the result repeat themselves but have the same postid then they are grouped. SELECT posts.id postid,posts.post_body,posts.post_type, ALLUSERS.USERNAME, likes.liker,likes.target, plikers.*, COUNT(posts.id) numberOflikes FROM posts INNER JOIN ALLUSERS ON(ALLUSERS.USERID=posts