Mean answer score as function of hour of the day for question and answer

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow en español

Preguntas y respuestas para programadores y profesionales de la informática

select DATEPART(hh, a.CreationDate) answerhour, 
       DATEPART(hh, q.CreationDate) questionhour,
       avg(1.00*a.score)  score
from posts a join posts q on q.Id = a.ParentId 
where a.PostTypeId in (2) and DATEPART(yyyy, q.CreationDate) >= 2017
group by DATEPART(hh, a.CreationDate), DATEPART(hh, q.CreationDate)
order by DATEPART(hh, a.CreationDate), DATEPART(hh, q.CreationDate)

Enter Parameters

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