instruction: List Users Ordered by a Tag Score Based on Location. Returns a list of users ordered by their score in a tag and in a location. Suitable to find out what is your ranking in tag in your location. - Thanks to @rene (http://meta.stackexchange.com/users/158100/rene)
response: SELECT u.Id AS "user_link", SUM(Score) AS totalscore FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id OR pt.PostId = p.ParentId INNER JOIN Tags AS t ON t.Id = pt.TagId INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE TagName = '##tag1:string##' COLLATE SQL_Latin1_General_CP1_CI_AI AND Location LIKE '%' + '##location:string##' + '%' COLLATE SQL_Latin1_General_CP1_CI_AI GROUP BY u.Id ORDER BY SUM(Score) DESC