title: Update using subquery and Case statements
body: <p>I was writing a update query with some case statements. when case doesn't satisfy it will update the column with NULL.<br/>
  Following is the query : <br/></p>
  
  <pre><code> UPDATE TGT
   SET C1 = CASE WHEN TGT.c2 = SRC.c2 AND SRC.C3 = 'P' THEN SRC.C1 ELSE NULL END,
       C4 = CASE WHEN TGT.c5 = SRC.c5 AND SRC.C3 = 'D' THEN SRC.C4 ELSE NULL END
      FROM SRC;
  </code></pre>
  
  <p>It is always populating NULL even data is existing in the Source table.</p>
  
  <p>Thanks In Advance for help.</p>