title: Using CASE to select a field in SQL?
body: <p>Based on if one field in the database is equal to something, I want to select the value of another field. I was thinking that I could use <code>CASE THEN</code> but I can't get it to return the value of a field.</p>
  
  <p>Here is what I have tried so far:</p>
  
  <pre><code>SELECT LastName, CASE FirstName WHEN 'Ian' THEN JobNo END FROM Employees
  </code></pre>
  
  <p><code>JobNo</code> is the name of the field which I want to get the value from.</p>