number of pending suggested edits per hour

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

;with range as (
select top 100000 row_number() over (order by id) [hour]
from posts
order by id
),
hours as 
(
select dateadd(hh, [hour], convert(datetime, ##start:string?2021-01-01##)) [time]
from range
)

select time
     , count(*) [# suggested]
from hours
inner join (
select creationdate
     , coalesce(approvaldate, rejectiondate, getdate()) [enddate]
from suggestededits
where creationdate between ##start:string?2021-01-01## 
                       and ##end:string?2021-03-14##
) data  on time between creationdate and enddate
where time < ##end:string?2021-03-14##
group by time
order by 1

Enter Parameters

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