title: Using If else in SQL Select statement
body: <p>I have a select statement which will return 2 columns.</p>
  
  <pre><code>ID | IDParent
  </code></pre>
  
  <p>Then in my program I have to test <code>if IDParent is &lt; 1 then use ID ELSE use IDParent</code></p>
  
  <p>Is there a way to use an If Else like condition in SQL to return only single value?</p>