title: SQL left outer join on multiple columns
body: <p>According to this <a href="http://www.codeproject.com/KB/database/Visual_SQL_Joins/Visual_SQL_JOINS_orig.jpg" rel="noreferrer">SQL join cheat-sheet</a>, a left outer join on one column is the following : </p>
  
  <pre><code>SELECT *
    FROM a
    LEFT JOIN b 
      ON a.foo = b.foo
    WHERE b.foo IS NULL 
  </code></pre>
  
  <p>I'm wondering what it would look like with a join on multiple columns, should it be an <code>OR</code> or an <code>AND</code> in the <code>WHERE</code> clause ?</p>
  
  <pre><code>SELECT *
    FROM a
    LEFT JOIN b 
      ON  a.foo = b.foo
      AND a.bar = b.bar
      AND a.ter = b.ter
  WHERE b.foo IS NULL 
    OR  b.bar IS NULL 
    OR  b.ter IS NULL
  </code></pre>
  
  <p>or </p>
  
  <pre><code>SELECT *
    FROM a
    LEFT JOIN b 
      ON  a.foo = b.foo
      AND a.bar = b.bar
      AND a.ter = b.ter
  WHERE b.foo IS NULL 
    AND b.bar IS NULL 
    AND b.ter IS NULL
  </code></pre>
  
  <p>?</p>
  
  <p>(I don't think it does, but in case it matters, the db engine is Vertica's)</p>
  
  <p>(I'm betting on the <code>OR</code> one)</p>