Answered/Unanswered Question Ratio over Time of Day

0

Please login or register to vote for this query.

(click on this box to dismiss)

Music Fans Meta

Q&A about the site for music historians, critics, and fans

SELECT
  datepart(hour, creationdate) AS [Hour],
  sum(case when p.AcceptedAnswerId > 0 then 1 else 0 end) as [Answered Questions],
  sum(case when p.AcceptedAnswerId > 0 then 0 else 1 end)*100 / count(p.Id) / 1.0 as [Percentage Unanswered]
FROM
  Posts as p
WHERE
  p.PostTypeId = 1 AND
  p.CreationDate > Convert(datetime, '2013-01-01')
  GROUP BY datepart(hour, creationdate)
ORDER BY [Hour]

Enter Parameters

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