WITH lv_users AS ( SELECT DisplayName, Location, Id FROM ...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Project Management

Q&A for project managers

WITH
lv_users AS
(
SELECT DisplayName, Location, Id
FROM Users
WHERE LOWER(location) LIKE '%latvija%' OR LOWER(location) LIKE '%latvia%'
),
users_with_more_than_100_badges AS
(
SELECT
UserId,
Count(Badges.Name) as badge_count
FROM badges
GROUP BY Badges.UserId, Badges.Name
HAVING Count(Badges.Name) > 100
)
SELECT * FROM
users_with_more_than_100_badges
JOIN lv_users
ON users_with_more_than_100_badges.UserId = lv_users.Id
ORDER BY badge_count DESC

Enter Parameters

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