title: MySQL Populate a new field with query results from another field in the same table
body: <p>I have a large (1 million + row) database/table that includes a "Name" field. However, I need a firstname and lastname field. </p>
  
  <p>I am able to run queries to display the fist and last names the way I need them in the new fields (parsing), but I can't seem to get those query results to INSERT into the table.</p>
  
  <p>I was able to create the fields in the table, but not populate them.</p>
  
  <p>I am working in phpMyAdmin, and the table was exported from Access via ODBC.</p>
  
  <p>A couple examples of code that doesn't work are below. It's been a few years since I had to work with SQL and I think maybe the logic of this approach is just wrong. I certainly appreciate any help.</p>
  
  <p>Example that doesn't work:</p>
  
  <pre><code>INSERT INTO fed2012_aquabarndesign_com (lastname)
  select left(Name,InStr(Name,',')) AS lastname
  from fed2012_aquabarndesign_com
  </code></pre>
  
  <p>or</p>
  
  <pre><code>INSERT INTO fed2012_aquabarndesign_com (lastname)
  Values (select left(Name,InStr(Name,',')) from fed2012_aquabarndesign_com);
  </code></pre>