title: Null check and comparing in then clause
body: <p>I have two tables in my database. First one is called F and the second one is T. F stores two information. "date_received" and "date_removed" that can be null. T stores only "date" that is an arbitrary date.
  F can store information for an object. For instance,</p>
  
  <p>2019-05-19        2019-05-31 ==> Means it belonged to someone between these dates</p>
  
  <p>2019-06-03        NULL ==> Means it still belongs to someone.</p>
  
  <p>I have two dates in T , 2019-05-25 and 2019-06-05.
  It is easy to find for 2019-05-25 because I can use BETWEEN clause but
  2019-06-05 I cannot. 
  I need to write if-else or case condition to check that if F.date_removed is null or not</p>
  
  <pre><code>CASE
    WHEN F.date_removed IS NULL THEN T.date &gt; F.date_received
    ELSE  T.date BETWEEN F.date_received AND F.date_removed
  END
  </code></pre>
  
  <p>How can I handle this issue. I need to switch between two comparing options according to being null of "date_removed"</p>