SELECT TO_NUMBER(TO_CHAR(DATETIME, 'HH24')) AS HOUR, COUNT(*) AS COUNT FROM ANIMAL_OUTS WHERE TO_NUMBER(TO_CHAR(DATETIME, 'HH24')) BETWEEN 09 AND 19 GROUP BY TO_CHAR(DATETIME, 'HH24') ORDER BY TO_CHAR(DATETIME, 'HH24');
예시나 문제를 잘 보자...