Q&A for scientists using computers to solve scientific problems
WITH UserPostCounts AS ( SELECT users.displayname, COUNT(posts.owneruserid) AS post_count FROM users JOIN posts ON posts.owneruserid = users.id WHERE users.location = 'Russia' GROUP BY users.displayname HAVING COUNT(posts.owneruserid) > SOME( SELECT COUNT(posts.owneruserid) FROM users JOIN posts ON posts.owneruserid = users.id WHERE users.location = 'Poland' GROUP BY users.displayname ) ) SELECT TOP 5 displayname, post_count FROM UserPostCounts ORDER BY post_count DESC;