title: SQL Query Count and Math Operations
body: <p>I have a unique query request.</p>
  
  <p>I run this query:</p>
  
  <pre><code>select * from documentationissues
  where dateAdded is not null
  and dateAdded &gt;= '2013-10-09 10:37:15.483'
  </code></pre>
  
  <p>This will return me however many rows have been inserted since the dateAdded clause.  What I am trying to do is do all of my math in the query as well.</p>
  
  <p>I need to figure out how many minutes have passed since the dateAdded clause.
  I need to get a count of how many rows that are returned.
  I then need to figure out on average how many rows are being done on average per minute and then per hour.
  And then say if there were 6,000,000 files to be done.  How many days it would take to process all of the files at the average day rate.</p>
  
  <p>If I ran the query right now it returned 2100 results as of today at 10:56:15 am.</p>
  
  <p>So that would be 19 minutes have passed which is about 110 rows per minute and about 6600 per hour.</p>
  
  <p>I'm not sure how to do all of the math in the select statement with grouping etc.</p>