title: Mysql: grouping by day and hours of day
body: <p>I have a database, and I've been trying for a while, but I'm not getting the results I want. Here's a sample of what I have:</p>
  
  <pre><code>+---------+---------------------+
  | Ammount | Date                |
  +---------+---------------------+
  |       1 | 2015-08-25 14:07:00 |
  |       1 | 2015-08-25 14:12:00 |
  |       1 | 2015-08-25 15:17:00 |
  |       2 | 2015-08-25 15:22:00 |
  |       1 | 2015-08-25 14:27:00 |
  |       6 | 2015-08-25 14:32:00 |
  |       1 | 2015-08-26 14:37:00 |
  |       5 | 2015-08-26 14:42:00 |
  |       1 | 2015-08-26 16:47:00 |
  |       2 | 2015-08-26 16:52:00 |
  +---------+---------------------+
  </code></pre>
  
  <p>And this is my query:</p>
  
  <pre><code>select Ammount, Date from table;
  </code></pre>
  
  <p>What I want to do is group by the day AND the hours of each day, and sum it, pretty much like this:</p>
  
  <pre><code>select sum(Ammount), Date from table group by hour(day(Date));
  </code></pre>
  
  <p>Except it groups everything together.</p>