Rise and fall of the Close Vote Queue (only latest items)


Please login or register to vote for this query.

(click on this box to dismiss)


Q&A for people studying math at any level and professionals in related fields

declare @maxdates int
declare @start date
select @start = (select min(creationdate) from votes where votetypeid = 6);
select @maxdates = datediff(d, @start, getdate())

/*create table #closevotes as
select v.creationdate,
coalesce(p.closeddate, v.creationdate) as deletiondate
from votes v
inner join posts p on p.id = v.postid
where votetypeid = 6 -- close vote
and v.creationdate < '2012-07-10'
-- starts at 2012-07-10
select creationdate
,  deletiondate
from reviewtasks 
where reviewtasktypeid = 2 -- close
--create index #cv_date on #closevotes(creationdate, deletiondate)
;with days as (
select top (@maxdates)
row_number() over(order by id) as rownum
from posts 

select dateadd(d, rownum, @start) as utcdate
     , count(*) as [# of tasks] 
from days d
--inner join #closevotes r 
        -- on dateadd(d,rownum, @start) between r.creationdate and r.deletiondate
group by rownum
order by rownum

Enter Parameters

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