Top 100 answers for a tag

1

Please login or register to vote for this query.

(click on this box to dismiss)

The Workplace Meta

Q&A about the site for members of the workforce navigating the professional setting

WITH TaggedQuestions AS (
  SELECT Posts.* FROM Posts
  JOIN PostTypes ON Posts.PostTypeId = PostTypes.Id
  JOIN PostTags ON PostTags.PostId = Posts.Id
  JOIN Tags ON PostTags.TagId = Tags.Id
  WHERE PostTypes.Name = 'Question'
  AND   Tags.TagName = '##tag##'
),
TaggedAnswers AS (
  SELECT Posts.* FROM Posts
  JOIN TaggedQuestions ON Posts.ParentId = TaggedQuestions.Id
  JOIN PostTypes ON Posts.PostTypeId = PostTypes.Id
  WHERE PostTypes.Name = 'Answer'
)
SELECT TOP 100
  TaggedAnswers.Id as [Post Link],
  TaggedAnswers.score as 'Score',
  Users.DisplayName as 'User'
FROM TaggedAnswers
JOIN Users ON TaggedAnswers.OwnerUserId = Users.Id
ORDER BY score DESC;

Enter Parameters

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