Most Upvoted Questions In A Tag

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

-- Most Upvoted Questions In A Tag

DECLARE @tagName nvarchar(max) = '##tag##'

SELECT TOP 10 Posts.Id AS [Post Link]--, Posts.Score
FROM PostTags
  INNER JOIN Posts ON Posts.Id = PostTags.PostId
  INNER JOIN Tags ON Tags.Id = PostTags.TagId
WHERE PostTypeId = 1 AND Tags.TagName = @tagName
GROUP BY Posts.Id
--ORDER BY Posts.Score DESC

Enter Parameters

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