Questions for which the accepted answer was posted on the same day they were asked

0

Please login or register to vote for this query.

(click on this box to dismiss)

Craft CMS Meta

Q&A about the site for administrators, end users, developers and designers for Craft CMS

SELECT datasource.SameDayAcceptedAnswer, datasource.TotalQuestions, CAST(datasource.SameDayAcceptedAnswer AS FLOAT) / CAST(datasource.TotalQuestions AS FLOAT) as Ratio FROM (SELECT COUNT(acceptedresponses.questionid) as SameDayAcceptedAnswer, allquestions.totalcount as TotalQuestions FROM (select question.id as questionid, cast(answer.creationdate - question.creationdate as float) as timediff from posts question join posts answer on answer.id = question.acceptedanswerid where question.posttypeid = '1') acceptedresponses LEFT OUTER JOIN (SELECT COUNT(id) AS totalcount FROM posts WHERE posttypeid = '1') allquestions ON 1=1 WHERE acceptedresponses.timediff <= 1 GROUP BY allquestions.totalcount) datasource

Enter Parameters

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