Average time between post creation and first vote

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow em Português

Perguntas e respostas para programadores profissionais e entusiastas

SELECT
CONVERT(DATETIME, CONCAT(YEAR(Posts.CreationDate), '-', MONTH(Posts.CreationDate), '-01'), 20) AS Mes,
avg(datediff(day,Posts.CreationDate,v.FirstVoteCD))
FROM (SELECT MIN(CreationDate) as FirstVoteCD, PostId FROM Votes GROUP BY PostId) v JOIN Posts on Posts.Id=v.PostId
GROUP BY YEAR(Posts.CreationDate), MONTH(Posts.CreationDate)
ORDER BY YEAR(Posts.CreationDate), MONTH(Posts.CreationDate)

Enter Parameters

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