Top ROWS answers in TAG for the past DAYS

0

Please login or register to vote for this query.

(click on this box to dismiss)

Music Fans Meta

Q&A about the site for music historians, critics, and fans

DECLARE @now DATETIME
SET @now=GETDATE()

SELECT TOP ##ROWS##

   Users.Id As Id,
   Users.DisplayName as Nickname,
   COUNT(Answers.Score) * 10 As Reputation

FROM Posts AS Answers

   INNER JOIN Posts AS Questions
   ON Questions.Id = Answers.ParentId

   INNER JOIN Users as Users
   ON Answers.OwnerUserId = Users.Id
   
   INNER JOIN PostTags
   ON PostTags.PostId = Answers.ParentId
   
   INNER JOIN Tags
   ON Tags.Id = PostTags.TagId
   
WHERE
     Answers.PostTypeId = 2
       AND Answers.OwnerUserId IS NOT NULL
       AND Tags.TagName = '##TAG##'
       AND DateAdd(d, ##DAYS##, Answers.CreationDate) > @now 
       
GROUP BY
     
     Users.Id, Users.DisplayName
     
ORDER BY

     Reputation DESC

Enter Parameters

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