Top Askers for a Given Tag

3

Please login or register to vote for this query.

(click on this box to dismiss)

The Stats of a Tag only gives the Top-20 askers. This query can list more of them and give other info as well.

Raspberry Pi

Q&A for users and developers of hardware and software for Raspberry Pi

-- Top Askers for a Given Tag
-- The Stats of a Tag only gives the Top-20 askers. This query can list more of them and give other info as well.


SELECT TOP 100
    Users.Id as [User Link],
    max(Age) as Age,
    max(Location) as Location,
    max(WebsiteUrl) as Website,
    max(Reputation) as Rep,
    Count(Posts.Id) as Questions,
    sum(Score) as Score,
    CAST(AVG(CAST(Score AS float)) as numeric(6,1)) as [Avg]
FROM Tags    
    JOIN PostTags ON PostTags.TagId = Tags.Id
    JOIN Posts ON Posts.Id = PostTags.PostId 
    JOIN Users ON Users.Id = Posts.OwnerUserId
WHERE    
    Tags.TagName = '##TagName##'
GROUP BY 
    Users.Id, DisplayName
ORDER BY 
    sum(Score) DESC

Enter Parameters

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