SELECT AVG(cast(response as bigint)) FROM (SELECT Id, ...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Web Applications Meta

Q&A about the site for power users of web applications

-- Most popular StackOverflow tags in May 2010

SELECT AVG(cast(response as bigint))

FROM

(SELECT Id,
       CreationDate as 'AACreationDate',
       accepted.ParentCreationDate,
       DATEDIFF(second, accepted.ParentCreationDate, CreationDate) as 'response'

FROM Posts INNER JOIN 

(SELECT AcceptedAnswerId,
        CreationDate as 'ParentCreationDate'
  FROM Posts
  WHERE Posts.CreationDate < '2018-01-01'
    AND Posts.CreationDate >= '2017-01-01'
    AND AcceptedAnswerID is NOT NULL
    ) as accepted 
    
    ON Posts.id=accepted.AcceptedAnswerId

) as response_time

Enter Parameters

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