Below are 2 queries:
SELECT COUNT(BUG.BG_BUG_ID) AS BUG_ID_SIT_CNT
FROM BUG
WHERE BUG.BG_USER_02 = 'SIT'
SELECT COUNT(BUG.BG_BUG_ID) AS BUG_ID_UAT_CNT
FROM BUG
WHERE BUG.BG_USER_02 = 'UAT'
How to write a query to use the results from the above queries and perform the below operation:
Defect Removal Efficiency: BUG_ID_SIT_CNT/(BUG_ID_SIT_CNT + BUG_ID_UAT_CNT)
SELECT BUG_ID_SIT_CNT * 1. / BUG_ID_ALL
FROM (
SELECT
COUNT(CASE WHEN BG_USER_02 = 'SIT' THEN BG_BUG_ID END) AS BUG_ID_SIT_CNT,
COUNT(BG_BUG_ID) AS BUG_ID_ALL
FROM BUG
WHERE BG_USER_02 IN ('SIT', 'UAT')
) t
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With