Oracle sql 統計

1.按小時統計數量spa

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');
相關文章
相關標籤/搜索