Q&A about the site for Drupal developers and administrators
select v.CreationDate, row_number() over (order by v.CreationDate) as RowNum, sum(case t.Name when 'UpMod' then 10 when 'AcceptedByOriginator' then 15 when 'DownMod' then -2 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 order by v.CreationDate