title: postgresql JOIN with multiple conditions
body: <p>I have two postgres tables:</p>
  
  <pre><code>worker_details_verification (verification_id BIGSERIAL, worker_id BIGINT, 
  state TEXT, proofs TEXT[])
  worker_details(worker_id BIGINT, name TEXT)
  </code></pre>
  
  <p>Now I want to get </p>
  
  <pre><code>    `verification_id, worker_id, proofs FROM` the table 
      `worker_details_verification`  
  </code></pre>
  
  <p>restricting records `WHERE state = 'Initial'</p>
  
  <p>Now in addition to the above three columns, I want the name column from the <code>worker_details</code> table too, where the <code>worker_id</code> can be used to query the worker's name.</p>
  
  <p>I tried the following query, but it did not work.</p>
  
  <pre><code>SELECT a.verification_id, a.worker_id, a.state, a.proofs, b.Name FROM 
  worker_details_verification a FULL OUTER JOIN worker_details b ON 
  a.worker_id = b.worker_id AND a.state = 'Initial';
  </code></pre>
  
  <p>It returns records where even a.state is not <code>'Initial'</code> and also some erroneous records where all <code>name</code> from <code>worker_detail</code> are returned with <code>NULL</code> for <code>worker_details_verification</code> columns.</p>