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%'
)
SELECT Badges.UserId, COUNT(Badges.Name), lv_users.DisplayName, lv_users.Location
FROM Badges
JOIN lv_users
ON Badges.UserId = lv_users.Id
GROUP BY Badges.UserId, Badges.Name, lv_users.DisplayName, lv_users.Location

Enter Parameters

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