Q&A for gamemasters and players of tabletop, paper-and-pencil role-playing games
SELECT TOP(##num?100##) RANK() OVER(ORDER BY Count(bs.Id) DESC) AS Rank, COUNT(bs.Id) AS [Number of bounties], SUM(bs.BountyAmount) AS [Total amount], p.Id AS [Post Link], p.Score, p.AnswerCount, p.OwnerUserId AS [User Link], p.Tags FROM Posts p INNER JOIN Votes bs ON p.Id = bs.PostId WHERE bs.VoteTypeId = 8 -- BountyStart GROUP BY p.Id, p.Score, p.AnswerCount, p.OwnerUserId, p.Tags ORDER BY COUNT(bs.Id) DESC