SELECT YEAR(q.CreationDate) AS year, COUNT(CASE WHEN a.Ac...

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 
  YEAR(q.CreationDate) AS year,
  COUNT(CASE WHEN a.AcceptedAnswerId IS NULL THEN 1 END) AS unaccepted_answers_count
FROM 
  Posts q
LEFT JOIN 
  Posts a ON q.Id = a.ParentId
WHERE 
  q.PostTypeId = 1 -- Question
GROUP BY 
  YEAR(q.CreationDate)
Order by
  YEAR(q.CreationDate) desc

Enter Parameters

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