title: Oracle: how to "group by" over a range?
body: <p>If I have a table like this:</p>
  
  <pre><code>pkey   age
  ----   ---
     1     8
     2     5
     3    12
     4    12
     5    22
  </code></pre>
  
  <p>I can "group by" to get a count of each age.</p>
  
  <pre><code>select age,count(*) n from tbl group by age;
  age  n
  ---  -
    5  1
    8  1
   12  2
   22  1
  </code></pre>
  
  <p>What query can I use to group by age ranges?</p>
  
  <pre><code>  age  n
  -----  -
   1-10  2
  11-20  2
  20+    1
  </code></pre>
  
  <p>I'm on 10gR2, but I'd be interested in any 11g-specific approaches as well. </p>