Reputation By year

0

Please login or register to vote for this query.

(click on this box to dismiss)

Ask Ubuntu

Q&A for Ubuntu users and developers

declare @userId int = ##userId##;
SELECT DATEPART(Year, v.CreationDate)as Year,
COUNT(v.Id) * 10 as Reputation, COUNT(p.Id) as Posts, COUNT(p.ViewCount) as Views
FROM Posts p
INNER Join Users u on p.OwnerUserId = u.Id
INNER JOIN Votes v on v.postId = p.Id
WHERE p.OwnerUserId = @userId
AND v.VoteTypeId = 2
GROUP BY DATEPART(Year, v.CreationDate)

Enter Parameters

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