title: MYSQL finding time span between two dates/times
body: <p>I have a table that has two fields dt(DateTime) and isblocked(Bit) </p>
  
  <p><img src="https://i.stack.imgur.com/eSWKp.png" alt="enter image description here"></p>
  
  <p>What I've been trying to do is find the time span between two dates/times where there is 45 mins continuously free - based on a start date/time.</p>
  
  <p>for example: based on the table above using 2012-12-11 13:30:00' as my start date.
  I would need values like this:</p>
  
  <pre><code>2012-12-11 15:30:00
  2012-12-11 16:45:00
  </code></pre>
  
  <p>I have tried some min and max queries, like:</p>
  
  <pre><code>SELECT MIN(dt), isbooked
  FROM booking
  WHERE dt &gt;= '2012-12-11 13:30:00' AND isbooked = 1
  GROUP BY dt
  LIMIT 1;
  </code></pre>
  
  <p>But I can't seem to get the right structure together. If more information is needed just let me know.</p>