All pastes #2087727 Raw Edit

Untitled

public text v1 · immutable
#2087727 ·published 2011-10-07 18:02 UTC
rendered paste body
select ji6.reporter, 
       sum((case when ji6.resolution = 1 then 1 else 0 end)) "Completed",
       sum((case when ji6.resolution not in (-1,1) then 1 else 0 end)) "NAR",
       sum((case when ji6.resolution = -1 then 1 else 0 end)) "Unresolved",
       count(ji6.id) "Total",
       sum((case when ji6.resolution not in (-1,1) then 1 else 0 end)) / cast((count(ji6.id) - sum((case when ji6.resolution = -1 then 1 else 0 end))) as decimal) "Ratio"
  from jiraissue ji6,
       issue_customer ic6
 where ji6.id = ic6.issue
   and ic6.customer not in ('QA','DEV')
   and ji6.type = 1 -- Only Bug type
   and ji6.created >= '04/02/2011'
   and ji6.created <= '07/01/2011'
   and ji6.reporter in (select ji6a.reporter from jiraissue ji6a where ji6a.type = 1 and ji6a.created >= '04/02/2011' and ji6a.created <= '07/01/2011' group by ji6a.reporter having COUNT(ji6a.id) > 15) 
 group by ji6.reporter
 order by "Ratio" desc