title: How do I perform an IF...THEN in an SQL SELECT?
body: <p>How do I perform an <code>IF...THEN</code> in an <code>SQL SELECT</code> statement?</p>
  
  <p>For example:</p>
  
  <pre><code>SELECT IF(Obsolete = 'N' OR InStock = 'Y' ? 1 : 0) AS Saleable, * FROM Product
  </code></pre>