title: UPDATE statement with multiple joins in PostgreSQL
body: <p>I'm trying to update a table called <code>incode_warrants</code> and set the <code>warn_docket_no</code> to the <code>viol_docket_no</code> from the <code>incode_violations</code> table.</p>
  
  <p>I have the following SQL query in Postgres 9.3, but when it fires I get the following error:</p>
  
  <blockquote>
  <pre><code>Error : ERROR:  relation "iw" does not exist
  LINE 1: update iw
  </code></pre>
  </blockquote>
  
  <p>I'm more of an Active Record person so my raw SQL skills are seriously lacking. I was wondering if anyone could help point me in the right direction on how to get this query right.</p>
  
  <pre><code>update iw
  set iw.warn_docket_no = iv.viol_docket_no
  from incode_warrants as iw
  INNER JOIN incode_warrantvs as iwvs
  on iw.warn_rid = iwvs.warnv_rid
  INNER JOIN incode_violations as iv
  ON iv.viol_citation_no = iwvs.warnv_citation_no and iv.viol_viol_no = iwvs.warnv_viol_no
  </code></pre>