title: SQL statement to collect data in a day-by-day, hour-for-hour fashion
body: <p>I have a database which gets updated with 200-1000 new rows per day. Now, I'd like to have an SQL-statement which returns the data day-by-day, hour-by-hour so I can give a rough estimate for the current trend, i.e. how many rows will be added to the database today, just by taking a quick look at those historical graphs.</p>
  
  <p>So, say that I would like to have 10 graphs printed out for the last 10 days, with the data summed up for every hour, like:</p>
  
  <p>Day9:21,24,15,18,...,30,28,25 : tot 348 (number of rows per hour for day 9 and the total)
  Day8:32,37,38,43,...,45,55,65 : tot 442 (number of rows per hour for day 8 and the total)
  ...
  ...
  Day0:18,25,28,X,Y... : tot 'S' (stats for today so far. What will S be?)</p>
  
  <p>How would the SQL-statement look like to collect the data in this day-by-day, hour-for-hour fashion?</p>
  
  <p>Instead of looking at the graps visually in order to give a rough estimate of today's total 'S', even better would be to compute a prediction of 'S'. But that would be a completely other problem I guess... Any tips for how to do that or hints where I can get more information would be much appreciated!</p>
  
  <p>Thanks,
  /Tommy</p>