title: Datepart function in oracle
body: <p>I have some sample records in Oracle 12</p>
  
  <pre><code>Date_Time               Item
  10/1/2012 12:05:00 AM   3
  12/3/2012 06:00:00 AM   2
  11/8/2012 14:05:05 PM   10
  12/9/2012 16:00:59 PM   5
  </code></pre>
  
  <p>I like to aggregate the Item field based on military time or in three different times: 00:00:00AM to 05:59:00AM, 06:00:00AM to 15:59:00PM, and 16:00:00PM to 23:59:00PM. I was able to use the Datepart function in SQL to do this. I was wondering what function in Oracle 12 that allows me to count the Item between these three different times.</p>
  
  <p>My desired output would be:</p>
  
  <pre><code>Date_Time                  Count
  00:00:00AM to 05:59:00AM = 3
  06:00:00AM to 15:59:00PM = 12
  16:00:00PM to 23:59:00PM = 5
  </code></pre>