반응형 5분1 Oracle 5분간 실패율 10%이상 집계 쿼리 SELECT COUNT(*) AS RESULT FROM ( SELECT FAIL_CNT / TOTAL_CNT AS RATE FROM ( SELECT S1.CNT AS SUCCESS_CNT , S2.CNT AS FAIL_CNT S1.CNT + S2.CNT AS TOTAL FROM (SELECT COUNT(*) AS CNT FROM TABLE1 WHERE DATE1 > SYSDATE - 1/24/12 AND STS = 1) S1, (SELECT COUNT(*) AS CNT FROM TABLE1 WHERE DATE1 > SYSDATE - 1/24/12 AND STS = 0) S2 ) S3 WHERE S3.TOTAL > 0 -- 0으로 나누면 안되므로 ) S4 WHERE RATE > 0.1; 2021. 11. 22. 이전 1 다음 반응형