Reputation from Answers to Closed 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 when v.VoteTypeId = 1 then 15 
           when v.VoteTypeId = 2 then 10
           when v.VoteTypeId = 3 then -2
           else 0 end)
  as 'Reputation'
from
  Posts q
    inner join Posts a
      on a.ParentId = q.Id
      inner join Votes v
        on v.PostId = a.Id
where
  a.CommunityOwnedDate is null
  and a.OwnerUserId = ##UserId##
  and a.postTypeId = 2
  and not (q.ClosedDate is null)

Enter Parameters

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