title: Mysql create freqency distribution
body: <p>I have a simple table BIRDCOUNT below, showing how many birds were counted on any given day:</p>
  
  <pre><code>+----------+
  | NUMBIRDS |
  +----------+
  | 123      |
  | 573      |
  | 3        |
  | 234      |
  +----------+
  </code></pre>
  
  <p>I would like to create a frequency distribution graph, showing how many times a number of birds were counted.  So I need MySQL to create something like:</p>
  
  <pre><code>+------------+-------------+
  | BIRD_COUNT | TIMES_SEEN  |
  +------------+-------------+
  | 0-99       | 17          |
  | 100-299    | 23          |
  | 200-399    | 12          |
  | 300-499    | 122         |
  | 400-599    | 3           |
  +------------+-------------+
  </code></pre>
  
  <p>If the bird count ranges were fixed this would be easy.  However, I never know the min/max of how many birds were seen.  So I need a select statement that:</p>
  
  <ol>
  <li>Creates an output similar to above, always creating 10 ranges of counts.</li>
  <li>(more advanced) Creates output similar to above, always creating N ranges of counts.</li>
  </ol>
  
  <p>I don't know if #2 is possible in a single select but can anyone solve #1?</p>