title: How to group by X minute increments in Presto SQL?
body: <p>I have data set that looks like the following : </p>
  
  <pre><code>Name, Timestamp, Period, Value
  Apple, 2012-03-22 00:00:00.000, 10, 34
  Apple, 2012-03-22 00:06:00.000, 10, 23
  Orange, 2012-03-22 00:00:00.000, 5, 3
  Orange, 2012-03-22 00:08:00.000, 5, 45
  </code></pre>
  
  <p>Where the column period is the N number of minutes it should be grouped by per hour. So for example Apple should be grouped on 1:10, 1:20, 1:30 ex where Orange is 1:05, 1:10 ect. I would also like to average the Value column over each of these increments.</p>