title: SQL Data Range Min Max category
body: <p>I want to determine the range of 2 categories. Category A and Category B. A starts from 1 to 15, B starts from 16 to 31 then A Again starts from 32 to 40.
  Now If run this query</p>
  
  <pre><code>select min(range), max(range) 
  from table
  group by category
  order by category
  </code></pre>
  
  <p>it gives me Range of category A from 1 to 40 and Category B from 16 to 31. I want to break the Range and want to see the results</p>
  
  <pre><code>Category A 1 to 15
  Category B 16 to 31
  Category A 32 to 40
  </code></pre>
  
  <p>How do I do that? Do I need a 3rd column? I know if i have 3rd column with new categories lets say C D E respectively, I can group by those and get the results. but I dont know how to do that.</p>
  
  <p>Please help me out. </p>
  
  <p>Thanks
  -Adeel</p>