Q&A for passionate videogamers on all platforms
-- Top Users by City and more than one tag SELECT ROW_NUMBER() OVER(ORDER BY Reputation DESC) AS [#], u.Id AS [User Link], u.Reputation, count(p.id) FROM Users u inner join posts p on p.ownerUserid = u.id inner join posttags pt on pt.postid = p.id inner join tags t on t.id = pt.tagid inner join tags t2 on t.id = pt.tagid inner join tags t3 on t.id = pt.tagid WHERE Location like '%##Location##%' and t.tagname='##tagname##' and t2.tagname='##tagname2##' and t3.tagname='##tagname3##' group by u.reputation, u.id ORDER BY Reputation DESC;