WHERE COLLECT_TIME BETWEEN TO_DATE('20110928000000', 'YYYYMMDDHH24MISS') AND TO_DATE('20110928235959', 'YYYYMMDDHH24MISS')
GROUP BY TO_CHAR(COLLECT_TIME, 'HH24')
ORDER BY CTIME
)
, B AS (
SELECT
TO_CAHR(TO_DATE((LEVEL-1) *60, 'SSSSS'), 'HH24:MI') AS CTIME
FROM DUAL
CONNECT BY LEVEL <= 1440
ORDER BY CTIME
)
SELECT
B.CTIME
, A.VAL1_AVG
, B.VAL1_AVG
FROM A, B
WHERE A.CTIME(+) = B.CTIME
ORDER BY B.CTIME