Distribution of the number of review actions on close review tasks that were invalidated

1

Please login or register to vote for this query.

(click on this box to dismiss)

Physics

Q&A for active researchers, academics and students of physics

declare @epoch as datetime = DATEADD(WEEK, - ##Weeks:int?52## - 1, CURRENT_TIMESTAMP);

select coalesce(total, 0) as '# Of Review Actions', 
       count(t.Id) as 'Count', 
       count(t.Id) * 100.0 / sum(count(*)) over () as 'Percent'
from ReviewTasks t
left outer join (
  select count(r.ReviewTaskId) as total, r.ReviewTaskId 
  from ReviewTaskResults r group by r.ReviewTaskId
) 
  as counts
  on t.Id = counts.ReviewTaskId 
where t.ReviewTaskTypeId = 2 -- Close
and t.ReviewTaskStateId = 3 -- Invalid
and t.CreationDate > @epoch
group by total
order by '# Of Review Actions';

Enter Parameters

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