title: UPDATE mySQL table using JOIN when two values match
body: <p>I'm attempting to use the following code to <code>JOIN</code> my MySQL tables, <code>TableA</code> and <code>TableB</code>, when both their <code>owner</code> and <code>pos</code> columns match, setting <code>TableA</code>'s <code>val</code> in the matching record to <code>TableB</code>'s <code>val</code>:</p>
  
  <pre><code>UPDATE TableA A 
  JOIN TableB B
  ON A.owner = B.owner AND A.pos = B.pos
  SET A.val = B.val
  </code></pre>
  
  <p>TableA has around 100,000 records and TableB has around 10,000 and there should only be one <code>owner</code>/<code>pos</code> match in each table. </p>
  
  <p>When I execute this query everything just hangs and I end up having to abort the execution. Is there something I'm missing syntactically or otherwise to get my desired result?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I have also tried the following; the results were the same:</p>
  
  <pre><code>UPDATE TableA 
  JOIN TableB
  ON TableA.owner = TableB.owner AND TableA.pos = TableB.pos
  SET TableA.val = TableB.val
  </code></pre>