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)

Board and Card Games Meta

Q&A about the site for people who like playing board games, designing board games or modifying the rules of existing board games

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

Enter Parameters

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