title: oracle compare date to null
body: <p>I have a query where i am comparing a date from one table to a max date from another table. The problem i am having is when the date is null that is being compared against. So take the following query:</p>
  
  <pre><code>select col1 from table1 where date &gt; (select max(date) from table b);
  </code></pre>
  
  <p>The query works fine except for when the subquery returns 0 rows. In the case of 0 rows i want it to return all rows. So in other words i want the date to compare to a datetime min value. So for in the case of 0 rows i want to compare:</p>
  
  <pre><code>date &gt; '01-01-1900'
  </code></pre>
  
  <p>I have tried using case statements with no luck but i feel like i am missing something simple.</p>
  
  <p>Any help would be much appreciated</p>