title: Lots of WHEN conditions in CASE statement (binning)
body: <p>How can I do binning in SQL Server 2008 if I need about 100 bins? I need to group records depending if a binning variable belongs to one of 100 equal intervals. 
  For example if there is continious variable age I could write:</p>
  
  <pre><code>CASE
     WHEN AGE &gt;= 0 AND AGE &lt; 1 THEN '1'
     WHEN AGE &gt;= 1 AND AGE &lt; 2 THEN '2'
     ...
     WHEN AGE &gt;= 99 AND AGE &lt; 100 THEN '100'
  END [age_group]
  </code></pre>
  
  <p>But this process would be timeconsuming? Are there some other ways how to do that?</p>