title: MYSQL: UPDATE rows based on SELECT from another table
body: <p>I have a 'users' table with 100 entries, each having an empty 'first_name' column. I wish to update each of these with names from another table. They do not need to correspond, they can be random, I just need data from one table into the other. I have found other people asking similar questions, but they all seem to have corresponding columns, like "username" being the same in either table and can get it working using a JOIN ON. As there are no corresponding columns I cannot do this.</p>
  
  <p>I currently have tried the following which does not work:</p>
  
  <pre><code>UPDATE users
  SET first_name =
    (
     SELECT `user_firstname`
     FROM past_users
     WHERE `active` = '1' LIMIT 100
    )
  </code></pre>
  
  <p>This gives the error:</p>
  
  <pre><code>Subquery returns more than 1 row
  </code></pre>
  
  <p>The only way it works is using LIMIT 1, which updates each entry with the same data. I want them each to be unique.</p>