title: Sql to group by 36 hours
body: <p>How do you write sql to return back results grouped by a 36 hour time period. With the results returning back the starting date of the 36 hour period, which would be be midnight.</p>
  
  <p>example data in table</p>
  
  <pre><code>&gt; date                      count
  &gt;--------------------------------   
  &gt;2015-05-14 01:00:00         1 
  &gt;2015-05-15 02:00:00         2    
  &gt;2015-05-15 20:00:00         3 
  &gt;2015-05-16 03:00:00         4
  </code></pre>
  
  <p>results wanted returned</p>
  
  <pre><code>&gt; date            count
  &gt;---------------------- 
  &gt;2015-05-14         3 
  &gt;2015-05-15         9    
  &gt;2015-05-16         4
  </code></pre>