title: Oracle / SQL Query
body: <p>How to get all the rows if the no of days parameter passed is <code>NULL</code>.</p>
  
  <p>Below is a part of my query: </p>
  
  <pre><code>and rti.creation_date &gt;sysdate - P_DAYS
  </code></pre>
  
  <p>(<code>P_days</code> can be <code>null</code> , in which case I need to get all the rows)</p>
  
  <p>will the below work :</p>
  
  <pre><code>and rti.creation_date &gt;=sysdate - NVL(:P_DAYS ,
       (Select TRUNC(SYSDATE)-TRUNC(min(creation_date)) from  
  apps.rcv_transactions_interface))
  </code></pre>