title: SQLite update query - subquery with aliases doesn't work
body: <p>I need to update a SQLite table. </p>
  
  <p>The table looks like:</p>
  
  <pre><code>ID   | Address            | CallNumber   |  RefID
  -----+--------------------+-------------------------------------------
  ef78 | library            | 2002/13      | 100002
  no56 | Lit                | 0189         | 100003
  rs90 | temp               |              | 100003
  </code></pre>
  
  <p>For every column with Address = "Lit" there is a column Address = 'temp' with the same RefID.
  Now I need to update each Address = "temp" with the value "CallNumber" from the column with the same RefID.</p>
  
  <p>The updated table should look like:</p>
  
  <pre><code>ID   | Address            | CallNumber   |  RefID
  -----+--------------------+-------------------------------------------
  ef78 | library            | 2002/13      | 100002
  no56 | Lit                | 0189         | 100003
  rs90 | 0189               |              | 100003
  </code></pre>
  
  <p>I tried this:</p>
  
  <pre><code>UPDATE Location
  SET address = foo.callnumber
  FROM (select RefID, CallNumber FROM Location) foo
  WHERE foo.RefID=Location.RefID AND Location.Address = 'temp';
  </code></pre>
  
  <p>But all I got is a syntax error near "from".</p>
  
  <p>Any clue?</p>