Most viewed questions in tag

0

Please login or register to vote for this query.

(click on this box to dismiss)

Drupal Answers Meta

Q&A about the site for Drupal developers and administrators

DECLARE @Tag VARCHAR(25) = '##Tag##'

SELECT TOP 10000
Questions.Id 
AS [Post Link],
Questions.Tags,
Questions.ViewCount,
Questions.CreationDate

FROM Posts AS Questions
    INNER JOIN PostTags 
    ON PostTags.PostId = Questions.Id
    INNER JOIN Tags
    ON Tags.Id = PostTags.TagId
    
WHERE Tags.TagName = @Tag AND Questions.CreationDate > '2015-01-01 00:00:00'

ORDER BY ViewCount DESC

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results