Question Id, Question Creation Time, Answer Id, Answer Creation Time

0

Please login or register to vote for this query.

(click on this box to dismiss)

Sera utilisé pour voir la distribution moyenne des réponses dans le temps

Moderators

Q&A for community managers, administrators, and moderators

DECLARE @p_date_from DATETIME
 DECLARE @p_date_to DATETIME
 SET     @p_date_from = CONVERT( DATETIME, '01 JAN 2008', 106 )
 SET     @p_date_to = CONVERT( DATETIME, '01 JAN 2011', 106 )

SELECT top 10 a.Id, 
              a.CreationDate, 
              AVG(ABS(DATEDIFF(minute, b.CreationDate, a.CreationDate)))
FROM Posts a, Posts b
WHERE b.ParentId = a.Id
AND a.CreationDate <= @p_date_to
AND a.CreationDate >= @p_date_from
GROUP BY a.Id, a.CreationDate,  b.CreationDate

Enter Parameters

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