title: MySQL Group By Dates Between
body: <p>Is there a way to group records that fall between two dates?</p>
  
  <p>For example, my table has records that look like this:</p>
  
  <pre><code>rid     stamp                   uid
  25      2005-07-05 14:10:29     25
  1175    2005-08-12 15:47:35     29
  290     2005-11-22 16:38:53     42
  30      2005-12-01 10:48:12     47
  30      2006-01-02 17:34:28     52
  30      2006-02-06 22:11:35     57
  30      2006-04-17 15:10:19     59
  1195    2006-05-08 21:55:56     62
  100     2006-06-30 15:51:04     94
  45      2006-07-03 21:14:37     24
  </code></pre>
  
  <p>I'm trying to write a query that will return a count of records between the months of <code>February - August</code> and between <code>September - January</code> by year, so that what I get back is:</p>
  
  <pre><code>July 2005 - January 2006:      3
  February 2006 - August 2006:   5
  </code></pre>