Q&A for professional and enthusiast programmers
SELECT COUNT(id) FROM ( SELECT p.id, Count(*) AS CommentCount FROM posts p INNER JOIN comments c ON c.postid = p.id GROUP BY p.id, p.title, p.creationdate, commentcount HAVING commentcount > 10 ) as t