title: plsql check at least one variable is not null inside where clause
body: <p>I'd like to filter columns, depending on two variables, namely (in pseudo code):</p>
  
  <ul>
  <li><strong>A</strong> if columns 1 and 2 are not null, then filter on both filter1 and filter2, otherwise</li>
  <li><strong>B</strong> if column 1 is not null, then do filter on filter1, otherwise</li>
  <li><strong>C</strong> if column 2 is not null, then do filter on filter2</li>
  </ul>
  
  <p>I have tried the following PL/SQL statement:</p>
  
  <pre><code>select * from table t where 
  ((t.column1 is not null and t.column1=filter1 and t.column2 is not null and t.column2=t.filter2) -- condition A
   or (t.column1 is not null and t.column1=filter1) -- condition B
   or (t.column2 is not null and t.column2=filter2)); -- condition C
  </code></pre>
  
  <p>Although I have checked that it works for each condition independently, it does not work on all three conditions. 
  E.g.: </p>
  
  <ul>
  <li>if there is only condition A, that works,</li>
  <li>or it there are only conditions B and C, that works.</li>
  <li>But that doesn't for condition A, B and C altogether.</li>
  </ul>
  
  <p>What is wrong ? Please help :)</p>