Unanswered questions that have a zero-score answer from the questioner

1

Please login or register to vote for this query.

(click on this box to dismiss)

Questions that can be marked as answered by upvoting a self-answered question.

Stack Apps

Q&A for apps, scripts, and development with the Stack Exchange API

-- Unanswered questions that have a zero-score answer from the questioner
-- Questions that can be marked as answered by upvoting a self-answered question.

SELECT top 5000 q.Id AS [Post Link],
      q.Creationdate,
      q.Score,
      q.Commentcount,
      q.Answercount,
      q.Viewcount,
      u.Reputation,
       SUM(Case When pf.VoteTypeId = 2 Then 1 ELSE 0 END) AS UpFeedback,
   SUM(Case When pf.VoteTypeId = 3 Then 1 ELSE 0 END) AS DownFeedback
   
   
FROM Posts q 
JOIN Users u ON u.Id = q.OwnerUserId
FULL OUTER JOIN PostFeedback pf ON q.Id = pf.PostId

WHERE q.PostTypeId = 1 
      AND q.ClosedDate IS NULL
      AND q.AcceptedAnswerId IS NULL
      AND q.AnswerCount > 0
      AND EXISTS (SELECT a.Id
                  FROM Posts a
                  WHERE a.Score = 0
                        AND a.ParentId = q.Id
                        AND a.OwnerUserId = q.OwnerUserId)
      AND NOT EXISTS (SELECT a.Id 
                      FROM Posts a 
                      WHERE a.Score > 0 
                            AND a.ParentId = q.Id) 
                            

group by q.id, 
q.creationdate, 
q.score, 
q.commentcount,
q.answercount, 
q.viewcount, 
u.reputation

ORDER BY U.Reputation desc, 
q.Creationdate,
q.id

Enter Parameters

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