with firstquery as ( select distinct id, creationdate,(s...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Vi and Vim

Q&A for people using the vi and Vim families of text editors

with firstquery as (

select distinct id, creationdate,(select min(creationdate) from posts a where a.parentid = posts.id and posttypeid = 2 group by a.parentid) mindate from posts 
where posttypeid = 1 and answercount >0 and year(creationdate) = 2015 

)

,secondquery as (
select a.id,datediff(minute,a.creationdate,a.mindate) firstanswertime
from firstquery a
where  mindate > creationdate ),

thirdquery as (
select top 50 percent  convert(bigint,firstanswertime) firstanswertime
from secondquery 
order by firstanswertime asc)

select avg(firstanswertime), min(firstanswertime),max(firstanswertime) from thirdquery



-- 2016 38

Enter Parameters

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