title: Creating a Bin column in Postgres to check an integer and return a string
body: <p>I have a large data set in a Postgres db and need to generate a field that groups rows into a respective bin for "0-100", "101-200", "201-300", etc. all the way up to nearly 5000. I am aware that I could manually update each row and produce a line of code for each bin like this:</p>
  
  <pre><code>update test
     set testgroup = '0-100' where testint &gt;= 1 and distance &lt; 100;
  </code></pre>
  
  <p>I really would like to figure out a more efficient way to do this, open to anything and everything! The main goal is to look at the integer in this 'testint' column and then if it is in between 1-100 return in the testgroup column "0-100".</p>