Total Reputation Per Question+Answer

0

Please login or register to vote for this query.

(click on this box to dismiss)

History

Q&A for historians and history buffs

SELECT Users.Id AS [User Link], Reputation, SUM(CASE WHEN Posts.PostTypeId = 1 OR Posts.PostTypeId = 2 THEN 1 ELSE 0 END) AS PostCount, Reputation / NULLIF(SUM(CASE WHEN Posts.PostTypeId = 1 OR Posts.PostTypeId = 2 THEN 1 ELSE 0 END),0) AS ReputationPerPost
FROM Users
JOIN Posts ON Posts.OwnerUserId = Users.Id
WHERE Users.Id = ##UserId##
GROUP BY Users.Id, Users.Reputation
HAVING SUM(CASE WHEN Posts.PostTypeId = 1 OR Posts.PostTypeId = 2 THEN 1 ELSE 0 END) >= 50
ORDER BY Reputation/NULLIF(SUM(CASE WHEN Posts.PostTypeId = 1 OR Posts.PostTypeId = 2 THEN 1 ELSE 0 END),0) DESC

Enter Parameters

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