AWS Questions: Time until Answer that was accepted

0

Please login or register to vote for this query.

(click on this box to dismiss)

Computational Science

Q&A for scientists using computers to solve scientific problems

SELECT
  --Question.id as [Post Link],
  SUM(CASE WHEN CAST(Answer.creationdate - Question.creationdate AS FLOAT) BETWEEN 0 AND 0.003472222222 THEN 1 END) as M5,
  SUM(CASE WHEN CAST(Answer.creationdate - Question.creationdate AS FLOAT) BETWEEN 0 AND 0.0833 THEN 1 END) as H2,
  SUM(CASE WHEN CAST(Answer.creationdate - Question.creationdate AS FLOAT) BETWEEN 0.0833 AND 0.1667 THEN 1 END) as H4,
  SUM(CASE WHEN CAST(Answer.creationdate - Question.creationdate AS FLOAT) BETWEEN 0.1667 AND .25 THEN 1 END) as H6,
  SUM(CASE WHEN CAST(Answer.creationdate - Question.creationdate AS FLOAT) BETWEEN .25 AND .5 THEN 1 END) as H12,
  SUM(CASE WHEN CAST(Answer.creationdate - Question.creationdate AS FLOAT) BETWEEN .5 AND .75 THEN 1 END) as H18,
  SUM(CASE WHEN CAST(Answer.creationdate - Question.creationdate AS FLOAT) BETWEEN .75 AND 1 THEN 1 END) as H24,
  SUM(CASE WHEN CAST(Answer.creationdate - Question.creationdate AS FLOAT) BETWEEN 1 AND 2 THEN 1 END) as D2,
  SUM(CASE WHEN CAST(Answer.creationdate - Question.creationdate AS FLOAT) BETWEEN 2 AND 3 THEN 1 END) as D3,
  SUM(CASE WHEN CAST(Answer.creationdate - Question.creationdate AS FLOAT) BETWEEN 3 AND 4 THEN 1 END) as D4,
  SUM(CASE WHEN CAST(Answer.creationdate - Question.creationdate AS FLOAT) BETWEEN 4 AND 5 THEN 1 END) as D5,
  SUM(CASE WHEN CAST(Answer.creationdate - Question.creationdate AS FLOAT) BETWEEN 5 AND 6 THEN 1 END) as D6,
  SUM(CASE WHEN CAST(Answer.creationdate - Question.creationdate AS FLOAT) >6 THEN 1 END) as DP

FROM Posts as Question
JOIN Posts as Answer ON Answer.Id = Question.AcceptedAnswerId

WHERE Question.PostTypeId = 1 -- Question
  AND Question.ClosedDate IS NULL -- Exclude Closed questions
  AND (Question.Tags LIKE '%<amazon-%' OR Question.Tags LIKE '%<aws-%')
  AND Question.CreationDate >= '2020-01-01'
  AND Question.creationdate <> Answer.creationdate -- Many are the same!
  AND Question.OwnerUserId <> Answer.OwnerUserId
  AND Answer.OwnerUserId <> 1144035

Enter Parameters

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