When post my question to maximize the answers?

1

Please login or register to vote for this query.

(click on this box to dismiss)

Meta Stack Exchange

Q&A for meta-discussion of the Stack Exchange family of Q&A websites

WITH AnswersPerQuestion(IdQuestion, NbAnswers, DayInWeek) AS
(
  SELECT
    p1.Id as IdQuestion,
    Count(p2.Id) as NbAnswers,
    DATENAME(WEEKDAY, p1.CreationDate) AS DayInWeek
  FROM
    Posts p1 JOIN Posts p2 ON p1.Id = p2.ParentId
  WHERE 
    p1.PostTypeId = 1 and p2.PostTypeId =2
  GROUP BY 
    p1.Id, DATEPART(WEEKDAY, p1.CreationDate), DATENAME(WEEKDAY, p1.CreationDate)
)
SELECT
  DayInWeek,
  AVG(CAST(NbAnswers as Float)) as avgAnswers
FROM
  AnswersPerQuestion a
GROUP BY
  DayInWeek
ORDER BY
  avgAnswers desc
;

Enter Parameters

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