title: Get nearest continuous date period MySQL
body: <p>I have this MySQL table:</p>
  
  <pre><code>| Date           | Room | State |
  |2015-06-15      | 26   | 1     | 
  |2015-06-16      | 26   | 1     | 
  |2015-06-17      | 26   | 1     | 
  |2015-06-18      | 26   | 1     | 
  |2015-06-20      | 26   | 1     | 
  |2015-06-21      | 26   | 0     | 
  |2015-06-22      | 26   | 0     | 
  |2015-06-23      | 26   | 1     | 
  |2015-06-24      | 26   | 0     | 
  |2015-06-30      | 26   | 1     | 
  |2015-07-01      | 26   | 1     |
  </code></pre>
  
  <p>I want to get the first date of the beginning of useful nearest (it means continuous day, <code>State = 1</code>) booking period (for example, 2 days).</p>
  
  <p>How can I do it?</p>