title: How to count records per ranged partition within a single select in oracle 12c?
body: <p>The solution I'm looking for (if it exists) is to directly partition by the actual partition and <strong><em>not</em></strong> by a calculated value.</p>
  
  <p><strong>Table Pseudo-Code:</strong></p>
  
  <pre><code>create table table_1 as (part_col DATE, val_col VARCHAR2(1))
  partition by range part_col (
     PARTITION t_20160515 VALUES LESS THAN (TO_DATE('2016-05-15','YYYY-MM-DD'))
     PARTITION t_20160516 VALUES LESS THAN (TO_DATE('2016-05-16','YYYY-MM-DD'))
     ...
  );
  </code></pre>
  
  <p><strong>Select Pseudo-Code:</strong></p>
  
  <pre><code>select partition as P, count(*) as C from table_1
  group by partition;
  </code></pre>
  
  <p><strong>Desired Result</strong></p>
  
  <pre><code>  P        |  C
  -----------|-----
  2016-05-15 | 8
  2016-05-16 | 99
  </code></pre>
  
  <p><strong>Works but not what I'm looking for:</strong></p>
  
  <pre><code>select trunc(part_col) P, count(*) C from table_1;
  </code></pre>