title: MySQL update a joined table
body: <p>I want to update a table in a statement that has several joins.  While I know the order of joins doesn't really matter (unless you you are using optimizer hints) I ordered them a certain way to be most intuitive to read.  However, this results in the table I want to update not being the one I start with, and I am having trouble updating it.  </p>
  
  <p>A dummy example of what I'd like to do is something like:</p>
  
  <pre><code>UPDATE b
  FROM tableA a
  JOIN tableB b
     ON a.a_id = b.a_id
  JOIN tableC c
     ON b.b_id = c.b_id
  SET b.val = a.val+c.val
  WHERE a.val &gt; 10
      AND c.val &gt; 10;
  </code></pre>
  
  <p>There are many posts about updating with joins here however they always have table being updated first.  I know this is possible in SQL Server and hopefully its possible in MySQL Too!</p>