Which tags had the most bounties offered in past 30 days?

1

Please login or register to vote for this query.

(click on this box to dismiss)

The Great Outdoors

Q&A for people who love being outdoors enjoying nature and wilderness, and learning about the required skills and equipment

-- Which tags had the most bounties offered in past 30 days?

SELECT
  COUNT(*) AS Bounty_Num,
  SUM(Votes.BountyAmount) AS Bounty_Amt,
  Tags.TagName
FROM Tags
  INNER JOIN PostTags ON PostTags.TagId = Tags.Id
  INNER JOIN Posts ON Posts.Id = PostTags.PostId
    AND Posts.PostTypeId = 1
    AND Posts.CreationDate >= DATEADD(day,-30,GETDATE())
    AND Posts.CreationDate <= GETDATE()
  INNER JOIN Votes ON Votes.PostId = Posts.Id
    AND Votes.VoteTypeId = 8 -- BountyStart
GROUP BY TagName
ORDER BY Bounty_Num DESC

Enter Parameters

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