title: Sum Column of Integers Based on Timestamp in PostgreSQL
body: <p>I am using PostgreSQL version 8.1.  I have a table as follows:</p>
  
  <pre><code>          datetime     |    usage 
  -----------------------+----------
  2015-12-16 02:01:45+00 |    71.615
  2015-12-16 03:14:42+00 |    43.000
  2015-12-16 01:51:43+00 |    25.111
  2015-12-17 02:05:26+00 |    94.087
  </code></pre>
  
  <p>I would like to add the integer values in the <code>usage</code> column based on the date in the <code>datetime</code> column.  </p>
  
  <p>Simply, I would like the output to look as below:  </p>
  
  <pre><code>          datetime     |    usage 
  -----------------------+----------
  2015-12-16             |    139.726
  2015-12-17             |    94.087
  </code></pre>
  
  <p>I have tried <code>SELECT dateTime::DATE, usage, SUM(usage) FROM tableName GROUP BY dateTime::DATE, lngusage;</code> which does not perform as expected.  Any assistance would be appreciated.  Thanks in advance.</p>