title: Select values not in a certain range in a table
body: <p>I have a table with an id column and hundreds of thousands of rows. I have been given a list of 1000 IDs to check other table data against. <strong>The IDs are not stored in order. The list of IDs is not in order either.</strong> When I select the table data using those ids only 990 results are returned, meaning since that list was produce, 10 of the results have changed/been removed. How can I find the 10 missing values from that range of data? This is what I'm doing at the moment:</p>
  
  <pre><code>select * from mytable
  where theId in (100, 2223, 31, 43321...92199, 14000)
  </code></pre>
  
  <p>Returns the 990 results. Can I do something like:</p>
  
  <pre><code>select val from (1, 2, 3, 4...999, 1000) 
  where val not in (
  select * from mytable
  where theId in (1, 2, 3, 4...999, 1000)
  )
  </code></pre>
  
  <p>EDIT: Sorry for the confusion. I should have mentioned that the ID's aren't in any particular order and I was just using the number 1000 as an example. They're in a random order and the 1000 is just a selection from a much larger table (100,000s of rows).</p>