title: How to find missing IDs in MySQL table
body: <p>I have a table where I have a row <code>id</code> that is my primary key. It is a table with ~250 thousand rows. Usually, the <code>id</code> should be a sequential number. Now I want to find out, if there is a number missing in the sequence of numbers.</p>
  
  <p>Example: The table contains the <code>id</code>s</p>
  
  <pre><code>1, 2, 4, 6, 7, 8, 9, 10
  </code></pre>
  
  <p>That means, in the sequence of numbers from <code>1</code> to <code>10</code>, the numbers <code>3</code> and <code>5</code> are missing.</p>
  
  <p>How would a MySQL query look like that only returns the missing <code>id</code>s? Is there a way to increment a counter and compare if that <code>id</code> exists?</p>