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