Posted By

geekzspot on 01/24/13


Tagged


Versions (?)

Oracle Group By Month and Year


 / Published in: SQL
 

Count the number of rows that fall within each Month

  1. SELECT TO_CHAR(TRUNC(create_time,'mm'),'Month YYYY') AS month, COUNT(*)
  2. FROM TABLE
  3. GROUP BY TRUNC(create_time,'mm')
  4. ORDER BY TRUNC(create_time,'mm') DESC
  5. ;

Report this snippet  

You need to login to post a comment.