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


Please login or register to vote for this query.

(click on this box to dismiss)

elementary OS Meta

Q&A for developers and users of elementary OS and applications

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) = 2016 


,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

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results