Average time to get the first answer / the accepted answer

1

Please login or register to vote for this query.

(click on this box to dismiss)

Motor Vehicle Maintenance and Repair Meta

Q&A about the site for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles

;with diffs as (
  select YEAR(q.CreationDate) * 100 + MONTH(q.CreationDate) as TheMonth, 
    cast(a.CreationDate - q.CreationDate as float) as d,
    row_number() over (PARTITION BY q.Id ORDER BY a.CreationDate) AS RowNo
  from Posts q
    join Posts a on a.ParentId = q.Id
  where a.Score > 0
    -- and q.CreationDate >= '20180101'
)
select TheMonth, avg(d) as AvgTimeToGetAnAnswer
from diffs
where RowNo = 1
group by TheMonth
order by TheMonth

;with diffs as (
  select YEAR(a.CreationDate) * 100 + MONTH(a.CreationDate) as TheMonth, 
    cast(a.CreationDate - q.CreationDate as float) as d
  from Posts q
    join Posts a on a.Id = q.AcceptedAnswerId
  where a.Score > 0
)
select TheMonth, avg(d) as AvgTimeToGetAnAnswer
from diffs
group by TheMonth
order by TheMonth

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results