Zero-score uncommented, not accepted answers by a specific user

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

select 
   sum(case when a.Score=0 and isnull(q.AcceptedAnswerId,0) != a.Id and a.CommentCount is null then 1 else 0 end) as [Unappreciated Answers], 
   count(a.Id) as [Total Answers], 
   100*cast(sum(case when a.Score=0 and a.CommentCount is null then 1 else 0 end) as float)/count(a.Id)  as [Percentage Unappreciated]
FROM Posts a
INNER JOIN Posts q 
ON (q.Id = a.ParentId)
WHERE a.PostTypeId=2 and a.OwnerUserId = ##UserId##

Enter Parameters

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