Question count by the number of answers per question


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

    q.Cnt as AnswerCount,
    count(*) as QuestionCount,
    count(*) * 100.0 / min(TotalQuestions) as 'Percent'
from (
    Select count(*) from Posts a where a.PostTypeId = 1
  ) as TotalQuestions, (
    Select count(*) from Posts a
    where a.ParentId = q.Id and a.PostTypeId = 2
  ) as Cnt
  from Posts q
  where q.PostTypeId = 1
  ) as q
group by q.Cnt
order by q.Cnt

Enter Parameters

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