Q&A about the site for Drupal developers and administrators
with Rep as ( select v.CreationDate, sum(case t.Name when 'UpMod' then 5 when 'AcceptedByOriginator' then 15 when 'DownMod' then -1 else 0 end) as Rep from Votes v inner join VoteTypes t on t.Id = v.VoteTypeId inner join Posts p on p.Id = v.PostId where p.OwnerUserId = ##UserId## group by v.CreationDate ) select a.CreationDate, sum(b.Rep) as Rep from Rep a inner join Rep b on b.CreationDate <= a.CreationDate group by a.CreationDate order by a.CreationDate