Average hours to first flag by post's creation date


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

-- @author: Moradnejad --
select d1f, avg(diff1)
    select d1,d2,
      FORMAT (d1, 'yy-MM') as [d1f],
      DATEDIFF(hour, d1, d2) as [diff1]
      select p.id, MIN(p.CreationDate) as d1, MIN(r.CreationDate) as d2
        from posts as p
        inner join [ReviewTasks] as r on r.PostId = p.id
        where p.posttypeid = 1 or p.posttypeid = 2
        group by p.id
    ) as t1
) as t2
group by d1f
order by d1f asc

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results