Q&A for people looking to bypass life's everyday problems with simple tricks
SELECT count(*) as numberofcomments, postid FROM posts JOIN comments ON posts.id = comments.postid GROUP BY postid