title: SQL Query to Select the 'Next' record (similar to First or Top N)
body: <p>I need to do a query to return the next (or prev) record if a certain record is not present. For instance consider the following table:</p>
  
  <pre><code>ID (primary key)    value
  1                    John
  3                    Bob
  9                    Mike
  10                   Tom.
  </code></pre>
  
  <p>I'd like to query a record that has id 7 or greater if 7 is not present. </p>
  
  <p>My questions are, </p>
  
  <ol>
  <li>Are these type of queries possible with SQL? </li>
  <li>What are such queries called in the DB world?</li>
  </ol>
  
  <p>Thanks!</p>