title: SQL Get the missing IDs
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/403291/find-missing-values">Find missing values</a><br>
    <a href="https://stackoverflow.com/questions/907284/how-do-i-get-first-unused-id-in-the-table">How do I get first unused ID in the table?</a>  </p>
  </blockquote>
  
  
  
  <pre><code>   myTable
  -----+---------
   ID  | Value
  -----+---------
   7   | Foo
   9   | Bar
   19  | Etc
  </code></pre>
  
  <p>I need to do a query here to get the missing ID (number 1), the result will be only the first row (result), maybe using <code>LIMIT 1</code>, and then insert using this ID. So, it will look this:</p>
  
  <pre><code>   myTable
  -----+---------
   ID  | Value
  -----+---------
   1   | Fir
   7   | Foo
   9   | Bar
   19  | Etc
  </code></pre>
  
  <p>Now on the next query it will result only the number 2.</p>
  
  <p>Notes:<br>
   - I am using MySQL 5.1.32</p>