title: Oracle Event Count Query
body: <p>My <code>SAMPLE</code> table has the following five columns:</p>
  
  <pre><code>sample_id (PK) (NUMBER)
  sampled_on (DATE)
  received_on (DATE)
  completed_on (DATE)
  authorized_on (DATE)
  </code></pre>
  
  <p>I would like a query with one row per hour (constrained by a given date range) and five columns:</p>
  
  <ol>
  <li>The hour <code>YYYY-MM-DD HH24</code></li>
  <li>Number of samples sampled during that hour</li>
  <li>Number of samples received during that hour</li>
  <li>Number of samples completed during that hour</li>
  <li>Number of samples authorized during that hour</li>
  </ol>
  
  <p>Please provide a query or at least a point in the right direction.</p>
  
  <p><strong>Reopened with bounty:</strong><br/>
  &nbsp;&nbsp;<strong>+300 reputation</strong> for the first person to incorporate <em>Rob van Wijk</em>'s answer (single access to sample) into a view where I can efficiently query by date range (<code>start_date/end_date</code> or <code>start_date/num_days</code>).</p>