title: How to filter based on date in certain cases in SQL?
body: <p>So let's say I have data like this:</p>
  <pre><code> ID   GROUP               TIMESTAMP1    col_OTHER               TIMESTAMP2
  001      AA  2021-04-02 15:02:33.319       mangos
  002      BB                                 kiwis
  004      AA  2021-04-02 03:51:35.279      oranges
  003      DD  2021-04-03 18:24:23.469      oranges  2021-04-03 18:22:23.469 
  003      DD                               bananas  2021-04-03 15:02:33.319
  002      CC  2021-04-04 11:02:51.313       apples  2021-04-04 11:03:51.313 
  
  </code></pre>
  <p>So I want to filter just the rows where <code>TIMESTAMP2</code> is after <code>TIMESTAMP1</code> . We only started collecting data on <code>TIMESTAMP2</code> April 3, no nulls after this but we have no data on this prior. So I want to apply this condition after this date.</p>
  <p>Additionally we sometimes have null values in <code>TIMESTAMP1</code>, I think my coalesce() solves that...?</p>
  <p>Final output:</p>
  <pre><code> ID   GROUP               TIMESTAMP1    col_OTHER               TIMESTAMP2
  001      AA  2021-04-02 15:02:33.319       mangos
  002      BB                                 kiwis
  004      AA  2021-04-02 03:51:35.279      oranges 
  003      DD                               bananas  2021-04-03 15:02:33.319
  002      CC  2021-04-04 11:02:51.313       apples  2021-04-04 11:03:51.313 
  
  </code></pre>
  <p>And here's what I have thus far:</p>
  <pre><code>SELECT * 
  FROM dt
  WHERE coalesce(TIMESTAMP1, '1970-01-01') &lt; TIMESTAMP2 
  </code></pre>
  <p>I would also be curious how to remove instances where I have NULL in both TIMESTAMP1 and TIMESTAMP2</p>