Среднее время ответа на вопрос по C#

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

-- 1 - Question
-- 2 - Answer

select
  DATEADD(m, DATEDIFF(m, 0, qi.CreationDate), 0) as Month,
  AVG(qi.Interval) as AveregeToFirstAnswer from
(
select
  q.Id as id,
  q.CreationDate as CreationDate,
  Min(a.CreationDate) as AnswerCreationDate,
  DATEDIFF(hh, q.CreationDate, Min(a.CreationDate)) as Interval
from Posts q inner join Posts a on a.ParentId = q.Id
where q.PostTypeId = 1 and a.PostTypeId = 2 and q.Tags like N'%<c#>%'
group by q.Id, q.CreationDate
having DATEDIFF(m, q.CreationDate, Min(a.CreationDate)) < 1 and DATEDIFF(m, q.CreationDate, Min(a.CreationDate)) >= 0
) as qi
group by DATEADD(m, DATEDIFF(m, 0, qi.CreationDate), 0)
order by 1

Enter Parameters

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