SELECT DISTINCT D.DBNAME , T.PTIASPRPTTAGNAME , T.PTIASPRPTTAGVALUE , ROUND((( SELECT COUNT(*) FROM PS_PTIASPLOGTGT L , PS_PTIASPRPTTAGS T2 WHERE L.PTIASPRPTNO = T2.PTIASPRPTNO AND L.DBNAME = D.DBNAME AND T2.PTIASPRPTTAGNAME = T.PTIASPRPTTAGNAME AND T2.PTIASPRPTTAGVALUE = T.PTIASPRPTTAGVALUE ) * 100 / ( SELECT COUNT(*) FROM PS_PTIASPRPTTAGS T1 WHERE T1.PTIASPRPTTAGNAME = T.PTIASPRPTTAGNAME AND T1.PTIASPRPTTAGVALUE = T.PTIASPRPTTAGVALUE)),2) AS PERCENT ,'Applied' AS "BUG Status" FROM PS_PTIASPRPTTAGS T, PS_PTIASPTGTDBVW D UNION SELECT DISTINCT D.DBNAME , T.PTIASPRPTTAGNAME , T.PTIASPRPTTAGVALUE , ROUND(100-(( SELECT COUNT(*) FROM PS_PTIASPLOGTGT L , PS_PTIASPRPTTAGS T2 WHERE L.PTIASPRPTNO = T2.PTIASPRPTNO AND L.DBNAME = D.DBNAME AND T2.PTIASPRPTTAGNAME = T.PTIASPRPTTAGNAME AND T2.PTIASPRPTTAGVALUE = T.PTIASPRPTTAGVALUE ) * 100 / ( SELECT COUNT(*) FROM PS_PTIASPRPTTAGS T1 WHERE T1.PTIASPRPTTAGNAME = T.PTIASPRPTTAGNAME AND T1.PTIASPRPTTAGVALUE = T.PTIASPRPTTAGVALUE)),2) AS PERCENT ,'Unapplied' AS "BUG Status" FROM PS_PTIASPRPTTAGS T, PS_PTIASPTGTDBVW D ORDER BY 1,2,3
|