title: Best way to update MySQL table with random values from another table
body: <p>For this (pseudo code) example I have two tables in MySQL:</p>
  
  <pre><code>member { id, name }
  names { name }
  </code></pre>
  
  <p>There are 100 members in member and 10 names. I want to use a random name from names to update the member table. So far I've got this, but, not sure if there is a better method to achieve it.</p>
  
  <pre><code>UPDATE member SET name = (SELECT name FROM names ORDER BY RAND() LIMIT 1);
  </code></pre>
  
  <p>The code will be executed from a script so I'm looking to avoid functions etc.</p>
  
  <p>Thanks in advance.</p>