distribution of unscored answers

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 
/*  a.Id as [Post Link], 
  a.Score, 
  a.CommunityOwnedDate, 
  a.postTypeId,
  a.AcceptedAnswerId,
  q.AcceptedAnswerId as [AnswerID],*/
 Count(*) as AnswerCount,
 IsAccepted
  /*(case st 
   when q.AcceptedAnswerId <> NULL then "Accepted" 
   when  q.AcceptedAnswerId IS NULL then "UnAccpted" 
   end st)*/
 --on a.Id = q.AcceptedAnswerId
 --v.VoteTypeId
FROM (
 select case when q.AcceptedAnswerId = a.Id then 0 else 1 end as IsAccepted
 from Posts a 
 left join
 Posts q
 ON q.Id = a.ParentId
WHERE 
 a.OwnerUserId = ##UserId## 
 and a.postTypeId = 2 
 and a.score = 0
) x
GROUP BY IsAccepted
    --(case when q.AcceptedAnswerId > 0 then [Accepted] else [UnAccpted] end)

Enter Parameters

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