title: SQL - How to find the highest number in a column?
body: <p>Let's say I have the following data in the Customers table: (nothing more)</p>
  
  <pre><code>ID   FirstName   LastName
  -------------------------------
  20   John        Mackenzie
  21   Ted         Green
  22   Marcy       Nate
  </code></pre>
  
  <p>What sort of <code>SELECT</code> statement can get me the number 22, in the ID column?</p>
  
  <p>I need to do something like this to generate a unique ID. Sure I can let the system do this via auto-increment, but then how would I get the auto generated ID?</p>
  
  <p>I thought of <code>SELECT ID FROM Customers</code> and counting the rows returned but this seems horribly inefficient, and in this case, it will incorrectly return "3", though I need a unique ID of 23.</p>