Q&A about the site for people organizing, marketing or licensing open source development projects
declare @userId int = ##userId##; SELECT DATEPART(Year, v.CreationDate)as Year, COUNT(v.Id) * 10 as Reputation, COUNT(p.Id) as Posts FROM Posts p INNER Join Users u on p.OwnerUserId = u.Id LEFT JOIN Votes v on v.postId = p.Id WHERE p.OwnerUserId = @userId AND v.VoteTypeId = 2 GROUP BY DATEPART(Year, v.CreationDate)