title: Oracle: Relative dates and date partitioned table
body: <p>I have a monthly partitioned table in Oracle by a <code>DATETIME</code> column. This table contains > 6 billion rows. Now I want to filter this table using <code>sysdate</code>. Thus, I can write queries using relative date as, for instance, yesterday, last weekday, last year etc...</p>
  
  <p>So, what I looking for is something like below code that works:</p>
  
  <pre><code>SELECT *
  FROM BIG_PART_TABLE PARTITION FOR (DATE **TODAY**)
  WHERE TRUNC(DATETIMECOLUMN) = TRUNC(SYSDATE)
  </code></pre>
  
  <p>But obviously, that won't work.</p>
  
  <p>Do you have any ideas so I can get it to work?</p>
  
  <p>Thanks!</p>