Users with Tags Score

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT Distinct u.Id AS [User Link],
                            CONCAT('https://stackoverflow.com/users/', u.Id) AS [Profile Link],
                            u.DisplayName,
                            'Tag:'+t.TagName, SUM(a.Score) as [Tag Score],
                            COUNT(*) as [Answer count]
FROM Users u
INNER JOIN Posts a ON a.OwnerUserId = u.id
INNER JOIN Posts q ON a.ParentId = q.Id
INNER JOIN PostTags pt ON pt.PostId = q.Id
INNER JOIN Tags t ON t.Id = pt.TagId
WHERE a.CommunityOwnedDate IS NULL AND   -- CW post don't count towards a tag score
     Upper(t.TagName) = Upper('%##TagName##%') AND
     Upper(u.Location) LIKE Upper('%##Location##%')
GROUP BY u.id, u.DisplayName, t.TagName
Having SUM(a.Score) > COUNT(*)
ORDER BY SUM(a.Score) DESC

Enter Parameters

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