title: SQL get avg values by timestamp interval
body: <p>I have the following table format:</p>
  <p>Data=[ID, value, timestamp]</p>
  <p>ie:</p>
  <pre><code>ID | value | timestamp
  1  |  20   | 2020-06-16 03:51:55
  2  |  30   | 2020-06-16 04:00:00
  3  |  10   | 2020-06-16 04:15:17
  4  |  12   | 2020-06-16 05:23:35
  </code></pre>
  <p>I want to retrieve avg values by timestamp interval 30 minutes. In the above example, the query should return 2 avg values 20 and 12.  Is that possible?</p>