a

0

Please login or register to vote for this query.

(click on this box to dismiss)

Electrical Engineering

Q&A for electronics and electrical engineering professionals, students, and enthusiasts

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;

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results