OpenRep attempt

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

select
 sub.CreationDay,
 sum(sub.RepGained) as TotalRepGained
from
(
 select
  (year(v.CreationDate)*500 + datepart(dy, v.CreationDate)) as CreationDay,
  p.OwnerUserId as Owner,
  (
   case
    when v.VoteTypeId=2 and p.PostTypeId=1 then 5
    when v.VoteTypeId=2 and p.PostTypeId=2 then 10
    when v.VoteTypeId=3 then -2
    when v.VoteTypeId=1 then 15
   end
  ) as RepGained
 from Votes v
  inner join Posts p on p.Id = v.PostId
) sub
where sub.Owner = ##UserId##
group by
 sub.CreationDay

Enter Parameters

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