title: “Not exists” across multiple joins
body: <p>I am learning sql (postgres) and id like to find values that do not exist.</p>
  <p>I have a table, table 1 with ids and i want to find those ids that are not in table 4.</p>
  <p>I have to join between 3 tables as table 1 holds id and table 4 contact_id (not the same number)</p>
  <p>The tables 2,3 need to be joined as that connects the ids.</p>
  <p>So how do i do that with “not exists”?</p>
  <pre><code>Select t1.id, table4.contact_id
  From table1 t1
  Join table2 using(id)
  Join table3 using(id)
  Join table4 using(contact_id)
  Where not exists (
    Select 1
    From table4
    Where table4.contact_id=t1.id
    );
  </code></pre>
  <p>It returns no values, but should
  No error msg…</p>
  <p>I have thinking error i assume</p>