title: Oracle Join Tables With Nulls
body: <p>I have two tables with a unique key. Below are examples of keys in the table</p>
  
  <pre><code>Table A                      Table B
  1                              3
  2                              4
  3
  4
  Null
  Null
  Null
  </code></pre>
  
  <p>I want to join Table A to Table B where the keys match or Table A has a null value. </p>
  
  <pre><code>The desired result set would be
  3
  4
  Null
  Null
  Null
  </code></pre>
  
  <p>I've tried a.key is null or a.key = b.key, but that is getting many many rows returned that I believe are duplicates. Also, here's the weird thing if do a.key is null or a.key = (select b.key from b where b.key = a.key) it works, but I want to avoid a subselect.</p>
  
  <p>Any ideas on what is going on?</p>