select top 2000 Id, CreationDate, firstAnswerDate, (Id) A...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Audio-Video Production Meta

Q&A about the site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation

select top 2000 Id, CreationDate, firstAnswerDate, (Id) AS [Postid], Score, Title, Tags,
(
  datediff(minute, question.creationDate, firstAnswerDate)
) as answerDiff
from (
  select *,
  (
    select min(answer.CreationDate) from Posts answer
    where
      answer.PostTypeId = 2
      -- successful answer (score is 5 or above)
      and answer.Score >= 5 
      and answer.DeletionDate is null
      and answer.parentId = question2.id
  ) as FirstAnswerDate
  from Posts question2
  where
    question2.PostTypeId = 1
    and YEAR(question2.CreationDate) = 2019
) question
where
  -- successful question (score is 10 or above)
  question.Score >= 10
  -- at least 5 minutes (prevent auto-answered questions, spam, etc)
  and datediff(minute, question.creationDate, firstAnswerDate) >= 5
  and question.FirstAnswerDate is not null
order by answerDiff asc;

Enter Parameters

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