title: How to update multiple matches by SQL?
body: <p>I have data from tableA (columns A1 and A2) that I want to update in tableB (columns B1 and B2) when A1 matches B1. So A2 value will be updated in B2 when A1 and B1 match</p>
  
  <p>The code below works but only for the first A1 and B2 match. In my database there are several matches and I would like to have all B2 values updated</p>
  
  <pre><code>$sql = "UPDATE tableB INNER JOIN tableA
  set tableB.B2 = tableA.A2
  where tableB.B1 = tableA.A1";
  </code></pre>
  
  <p>Any idea how to have all tableB.B2 values updated each time tableB.B1 = tableA.A1?</p>