title: Grouping by a range of values in SQL
body: <p>My table is as following:</p>
  
  <pre><code>id | label_id | value
  1  | 1        | 500
  2  | 1        | 600
  3  | 1        | 900
  4  | 1        | 10000
  5  | 1        | 300
  6  | 2        | ...
  ....................
  </code></pre>
  
  <p>Now, I want to generate a query result such as:</p>
  
  <pre><code>caption        | count
  Less than 500  | 1
  500 to 900     | 2
  Above 900      | 1
  </code></pre>
  
  <p>In short, I'm trying to partition the result set so it is grouped by a range of values.
  Any ideas?</p>
  
  <p>The partition groups obviously would be pre-defined, meaning I'd know ahead of time that my partition scheme should be: &lt; 500, 500 - 900, 900+ and so forth.</p>
  
  <p>Thank you!</p>