title: Creating bins in presto sql - programmatically
body: <p>I am new to Presto SQL syntax and and wondering if a function exists that will bin rows into <code>n</code> bins in a certain range.</p>
  
  <p>For example, I have a a table with 1m different integers that range from 1 - 100.   What can I do to create 20 bins between 1 and 100 (a bin for 1-5, 6-10, 11-15 ... etc. ) without using 20 separate <code>CASE WHEN</code> statements ? Are there any standard SQL functions that do will perform the binning function?    </p>
  
  <p>Any advice would be appreciated!</p>