title: How to use a column value in if condition?
body: <blockquote>
  <pre><code>Appr_ID   Status
  ----------------
  Null      1
  3         2
  4         3
  NULL      4
  7         5
  NULL      6
  </code></pre>
  </blockquote>
  
  <p>I've two columns in a table, which have values as shown above. </p>
  
  <p>I need to write a Stored Procedure so that whenever <code>Appr_ID</code> column has a Not Null value, it would fetch and display data from certain tables with some multiple joins. </p>
  
  <p>When <code>Appr_ID</code> column is NULL, again it will have to use some different conditions to fetch and display the data. </p>
  
  <p>My problem is, when I try to use <code>if</code>-<code>else</code> statement, it is not possible to use a column value as a condition in if statement, like</p>
  
  <pre><code>If Appr_ID is Null then
    Select...
  Else
    Select...
  </code></pre>
  
  <p>So, please suggest alternate ideas to accomplish the scenario.</p>
  
  <p>Thanks in advance, Krishna</p>