SELECT SUM(bs.BountyAmount) AS Amount, p.Id AS [Post Link],

0

Please login or register to vote for this query.

(click on this box to dismiss)

Drupal Answers

Q&A for Drupal developers and administrators

SELECT 
  SUM(bs.BountyAmount) AS Amount,
  p.Id AS [Post Link],
  p.AnswerCount AS ac
FROM Posts p LEFT OUTER JOIN Votes bs ON p.Id = bs.PostId
WHERE bs.VoteTypeId = 8  -- BountyStart
GROUP BY p.Id, p.AnswerCount
ORDER BY SUM(bs.BountyAmount) DESC

Enter Parameters

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