Bounties: on own questions vs. others' questions

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT
  SUM(CASE v.UserId WHEN p.OwnerUserId THEN 1 ELSE 0 END) AS 'Own',
  100 * SUM(CASE v.UserId WHEN p.OwnerUserId THEN 1 ELSE 0 END) / COUNT(*) AS '%',
  SUM(CASE v.UserId WHEN p.OwnerUserId THEN 0 ELSE 1 END) AS 'Other',
  100 * SUM(CASE v.UserId WHEN p.OwnerUserId THEN 0 ELSE 1 END) / COUNT(*) AS '%'
  FROM Votes AS v
  INNER JOIN Posts AS p ON v.PostId = p.Id
  WHERE v.VoteTypeId = 8 -- BountyStart

Enter Parameters

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