title: Conditional update statement in Oracle
body: <p>I have a problem with building a conditional update statement in <strong>Oracle</strong>. For understandability, I'll simplify the problem and basically my update statement should look like this:</p>
  
  <pre><code>UPDATE SAMPLE_TAB1 t 
     SET t.sample_column1 =NVL(t.sample_column1, **SOME LOGIC**);
  </code></pre>
  
  <p>The <code>***SOME LOGIC***</code> part should look like this: (Please consider this is just a pseudo code)</p>
  
  <pre><code>IF ((SELECT sample_column2 FROM SAMPLE_TAB2 
         WHERE sample_column2= sample_value2
         AND sample_column3  = sample_value3 )='FALSE' THEN 
     t.sample_column1 =0;
  ELSE
  
     t.sample_column1 =(SELECT sample_column1 FROM SAMPLE_TAB3 
                           WHERE sample_column4= sample_value4
                           AND sample_column5  = sample_value5 )
  
  END IF;
  </code></pre>
  
  <p>Any kind of thoughts on this problem would be welcome. Thank you.</p>