Most popular questions for a tag

2

Please login or register to vote for this query.

(click on this box to dismiss)

User Experience

Q&A for user experience researchers and experts

-- Most popular questions for a tag

DECLARE @Tag NVARCHAR(200) = ##Tag:string##

SELECT TOP 20
    Posts.Id
    , 'https://stackoverflow.com/questions/' + CAST(Posts.Id as varchar(10)) AS Url
    , Posts.Title
    , Posts.Tags
    , Posts.Score
    , Posts.AnswerCount
    , Posts.CommentCount
FROM Tags
    INNER JOIN PostTags ON PostTags.TagId = Tags.id
    INNER JOIN Posts ON Posts.Id = PostTags.PostId
WHERE
    PostTypeId = 1
    AND TagName = @Tag
ORDER BY Score DESC

Enter Parameters

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