select count(*) [total reviews] , sum(case when ReviewTas...

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

select count(*) [total reviews]
     , sum(case when ReviewTaskResultTypeid = 1 then 1 else 0 end) [skip]
     , (convert(decimal, sum(case when ReviewTaskResultTypeid = 1 then 1 else 0 end)) /
       count(*)) *100 [perc]
from reviewtasks rt
inner join ReviewTaskResults rtr on rtr.reviewtaskid = rt.id
where reviewtasktypeid = 1

Enter Parameters

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