Questions with many comments but no accepted answer

2

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SET STATISTICS IO ON;

SELECT TOP 100 q.Id AS [Post Link], q.CreationDate AS QuestionDate, 
  Answers = (SELECT COUNT(*) FROM dbo.Posts a WHERE q.Id = a.ParentId AND a.PostTypeId = 2),
  AnswersUpvoted = (SELECT COUNT(*) FROM dbo.Posts a WHERE q.Id = a.ParentId AND a.PostTypeId = 2 AND a.Score > 1),
  COUNT(c.Id) AS CommentCount, MAX(c.CreationDate) AS MostRecentCommentDate
FROM Posts q
INNER JOIN Comments c ON q.Id = c.PostId
WHERE q.AcceptedAnswerId IS NULL
   AND q.PostTypeId = 1
   AND q.ClosedDate IS NULL
GROUP BY q.Id, q.Title, q.CreationDate
HAVING COUNT(c.Id) > 10
ORDER BY CommentCount DESC

Enter Parameters

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