Oracle summarizes according to the time statistics statement
Oracle summarizes according to the time statistics statement the Oracle statistics statement by day http://www.2cto.com/database/201208/148040.html Oracle statistics statement by week http://www.2cto.com/database/201208/148083.html Oracle statistics statement by month http://www.2cto.com/database/201208/148041.html Oracle statistics statement by quarter http://www.2cto.com/database/201208/148085.html Oracle statistics statement by year http://www.2cto.com/database/201208/148086.html the After reading the few articles I posted above, we can easily find a pattern. the According to the time statistics are also regular… the Did you notice any difference? the –Statistics by day SELECT TO_CHAR(T.MODIFIEDTIME,’YYYY-MM-DD’) TIME,COUNT(*) COUNT FROM TEST T –You can add query conditions here WHERE TO_CHAR(T.MODIFIEDTIME,'YYYY') = TO_CHAR(SYSDATE,'YYYY') GROUP BY TO_CHAR(T.MODIFIEDTIME,'YYYY-MM-DD') –Group by date ORDER BY TO_CHAR(T.MODIFIEDTIME, & # 39; YYYY-MM-DD & # 39;) ASC NULLS LAST — Sort by date the –Statistics by week SELECT TO_CHAR(T.MODIFIEDTIME,'YYYY') YEAR,TO_CHAR(T.MODIFIEDTIME,'IW') TIME,COUNT(*) COUNT www.2cto.com FROM TEST T –You can add query conditions here WHERE TO_CHAR(T.MODIFIEDTIME,'YYYY') = TO_CHAR(SYSDATE,'YYYY') GROUP BY TO_CHAR(T.MODIFIEDTIME,'IW'),TO_CHAR(T.MODIFIEDTIME,'YYYY') –Group by week number ORDER BY TO_CHAR(T.MODIFIEDTIME,'YYYY'),TO_CHAR(T.MODIFIEDTIME,'IW') ASC NULLS LAST –sort by week number the — Statistics by month SELECT TO_CHAR(T.MODIFIEDTIME,’YYYY-MM’) TIME,COUNT(*) COUNT FROM TEST T –You can add query conditions here WHERE TO_CHAR(T.MODIFIEDTIME,'YYYY') = TO_CHAR(SYSDATE,'YYYY') GROUP BY TO_CHAR(T.MODIFIEDTIME,'YYYY-MM') –Group by month ORDER BY TO_CHAR(T.MODIFIEDTIME,’YYYY-MM’) ASC NULLS LAST –sort by month the –Statistics by quarter SELECT TO_CHAR(T.MODIFIEDTIME,'YYYY') YEAR,TO_CHAR(T.MODIFIEDTIME,'Q') TIME,COUNT(*) COUNT FROM…