How many helpful answers have I posted?

0

Please login or register to vote for this query.

(click on this box to dismiss)

How many of my answers were either accepted or have score > 0?

Project Management

Q&A for project managers

-- How many helpful answers have I posted?
-- How many of my answers were either accepted or have score > 0?

DECLARE @UserId int = ##UserId##

SELECT 
a.id,
case when a.PostTypeId = 2 then Count(a.Id) end AS Accepted,
case when a.PostTypeId = 2 then Count(a.Id) end AS 'score>0',
case when a.PostTypeId = 2 then Count(a.Id) end AS 'acceptedorscore>0'
FROM Posts q INNER JOIN
Posts a ON q.AcceptedAnswerId = a.Id
WHERE a.OwnerUserId = @UserId
group by a.id, a.PostTypeId

Enter Parameters

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