CREATE TABLE #FirstAnswers (QuestionId int not null, Time...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Vegetarianism

Q&A for those committed to a vegan or vegetarian lifestyle and anyone interested in learning more

CREATE TABLE #FirstAnswers (QuestionId int not null, TimeElapsed int)
GO
Insert Into #FirstAnswers
select QuestionId, DATEDIFF(second, QuestionCreationDate, AnswerCreationDate) as TimeElapsed
from 
(( select Id as QuestionID, CreationDate as QuestionCreationDate, Score as QuestionScore from Posts where PostTypeID=1) as Questions inner join 
(select Id as AnswerID, ParentID, CreationDate as AnswerCreationDate, Score as AnswerScore from Posts where PostTypeID=2) as Answers on Questions.QuestionId=Answers.ParentId)
GO
select count(*)
from
(Select QuestionID, MIN(TimeElapsed) as mt
from #FirstAnswers
group by QuestionID) As X
where X.mt < 60*4 and X.mt >= 60*3

Enter Parameters

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