Average hours to first flag by post's creation date

2

Please login or register to vote for this query.

(click on this box to dismiss)

Health Meta

Q&A about the site for professionals in medical and allied health fields, students of those professions, related academics, and others with a sound understanding of medicine and healthcare-related sciences

-------------------------
-- @author: Moradnejad --
-------------------------
select d1f, avg(diff1)
from
(
    select d1,d2,
      FORMAT (d1, 'yy-MM') as [d1f],
      DATEDIFF(hour, d1, d2) as [diff1]
    from
    (
      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

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