1.按小时统计数量
SELECT TO_CHAR(RECEIVE_TIME,'HH24') HOUR ,COUNT(*) N FROM PH_PRESCRIPTION P
WHERE TO_CHAR(P.RECEIVE_TIME ,'YYYY-MM-DD')='2018-12-05'
GROUP BY TO_CHAR(RECEIVE_TIME,'HH24')
ORDER BY TO_CHAR(RECEIVE_TIME,'HH24');
1.按小时统计数量
SELECT TO_CHAR(RECEIVE_TIME,'HH24') HOUR ,COUNT(*) N FROM PH_PRESCRIPTION P
WHERE TO_CHAR(P.RECEIVE_TIME ,'YYYY-MM-DD')='2018-12-05'
GROUP BY TO_CHAR(RECEIVE_TIME,'HH24')
ORDER BY TO_CHAR(RECEIVE_TIME,'HH24');