title: Performing a query on a result from another query?
body: <p>I have a the query:</p>
  
  <pre><code>SELECT availables.bookdate AS Date, DATEDIFF(now(),availables.updated_at) as Age
  FROM availables
  INNER JOIN rooms
  ON availables.room_id=rooms.id
  WHERE availables.bookdate BETWEEN '2009-06-25' AND date_add('2009-06-25', INTERVAL 4 DAY) AND rooms.hostel_id = 5094
  GROUP BY availables.bookdate
  </code></pre>
  
  <p>Which returns something like:</p>
  
  <pre><code>Date               Age
  2009-06-25         0
  2009-06-26         2
  2009-06-27         1
  2009-06-28         0
  2009-06-29         0
  </code></pre>
  
  <p>How can I then do a Count on the number of rows which is returned.. (in this case 5) and an SUM of the Ages?  To return just one row with the Count and the SUM?</p>
  
  <pre><code>Count         SUM
  5             3
  </code></pre>
  
  <p>Thanks</p>