title: SQL query over period of time
body: <p>I have a table in MySQL with some data of a temperature sensor. I have 1 row per minute. I would like to perform a query to know whether there was any span of 1 hour where the average temperature was greater than 4 degrees. I know how to perform a query where a single row was above 4:</p>
  
  <pre><code>SELECT * FROM sensor WHERE t&gt;4
  </code></pre>
  
  <p>But in my case, I want to know whether there was a 1 hour period where the average temperature was over 4, not only a single row.</p>
  
  <p>Not sure how to write such query...</p>