title: putting data into categories (buckets) based on a value
body: <p>how can i assign a category based on a value?</p>
  
  <p>for example, i have a table with values from 1-200. how do i assign a category to each record, like 1-5, 6-10, 11-15, etc.</p>
  
  <p>i can do it using the below but that seems like a bad solution.</p>
  
  <p>sorry, this is probably very basic but i don't know what it's called and googling buckets (as it's called in our company) didn't bring up any results.</p>
  
  <p>thank you</p>
  
  <pre><code>SELECT DISTINCT CountOfSA,
   CASE
                WHEN CountOfSA BETWEEN 1 AND 5 THEN
                     '1-5'
                WHEN CountOfSA BETWEEN 6 AND 10 THEN
                     '6-10'
                WHEN CountOfSA BETWEEN 11 AND 15 THEN
                     '11-15'
                WHEN CountOfSA BETWEEN 16 AND 20 THEN
                     '16-20'
                WHEN CountOfSA BETWEEN 21 AND 25 THEN
                     '21-25'
                WHEN CountOfSA BETWEEN 26 AND 30 THEN
                     '26-30'
           END
                AS diff
                FROM NR_CF_212
  </code></pre>