title: SQL join only if there is no match
body: <p>I have a (postgres) sql table that has the following contents (Hosts):</p>
  
  <pre><code>   ip_address   |  mac_address   | hostname | device | physical_port
  ----------------+----------------+----------+--------+---------------
  111.111.111.111 | aaaa.aaaa.aaaa | hosta    | swh-a  | Gi1/1
  111.111.111.112 | bbbb.bbbb.bbbb | hostb    | swh-b  | Gi2/1
  111.111.111.113 | cccc.cccc.cccc | hostc    | swh-c  | Gi3/1
  </code></pre>
  
  <p>I have another table (Peers) that contains point-to-point links between <code>devices</code> in the able table.</p>
  
  <pre><code> device | physical_port | peer_device | peer_physical_port 
   -------+---------------+-------------+----------------------+
   swh-a  | Gi1/20        | swh-b       | Gi2/1
   swh-b  | Gi2/1         | swh-a       | Gi1/20
   swh-b  | Gi2/1         | swh-c       | Gi3/1
   swh-c  | Gi3/1         | swh-b       | Gi2/1
  </code></pre>
  
  <p>Basically, I would like the <strong>exclude</strong> entries from the Hosts table that are contained within the Peers table such that I only get:</p>
  
  <pre><code>   ip_address   |  mac_address   | hostname | device | physical_port
  ----------------+----------------+----------+--------+---------------
  111.111.111.111 | aaaa.aaaa.aaaa | hosta    | swh-a  | Gi1/1
  </code></pre>
  
  <p>(given that <code>device=swh-b physical_port=Gi2/1</code> and <code>device=swh-c physical_port=Gi3/1</code> exist within the Peers table).</p>