颗粒化查询统计sql
SELECT TO_CHAR (to_date(substr(PAY_TIME,12,2), 'hh24'),'hh24') || ':' || LPAD ( FLOOR (TO_CHAR(TO_DATE(SUBSTR(PAY_TIME,15,2),'mi'), 'mi') / 5) * 5, 2, 0 ) cjsj, COUNT (*) num FROM PAY_ORDER_INFO GROUP BY TO_CHAR (to_date(substr(PAY_TIME,12,2), 'hh24'),'hh24') || ':' || LPAD ( FLOOR (TO_CHAR(TO_DATE(SUBSTR(PAY_TIME,15,2),'mi'), 'mi') / 5) * 5, 2, 0 ) ORDER BY TO_CHAR (to_date(substr(PAY_TIME,12,2), 'hh24'),'hh24') || ':' || LPAD ( FLOOR (TO_CHAR(TO_DATE(SUBSTR(PAY_TIME,15,2),'mi'), 'mi') / 5) * 5, 2, 0 );