title: How do you update multiple fields from another table in mysql?
body: <p>This is the query I'm trying to accomplish:</p>
  
  <pre><code>update amdashboard
  set (ASCID, ASCFirst, ASCLast, ASCOtherName, ASCAdd1, ASCAdd2,
       ASCCity, ASCState, ASCZip, ASCZip4, ASCY2007, ASCY2008, ASCY2009,
       ASCY2010, ASCY2011, ASCY2012, ASCEthnicity, ASCGender, ASCMaritalStatus)
  = (select id, firstname, lastname, listingspousename, add1, add2,
            city, state, zip, zip4, y2007, y2008, y2009,
            y2010, y2011, y2012, Ethnicity, Gender, MaritialStatus
       from ASCNCOAClean
            inner join amdashboard
            on ASCNCOAClean.firstname = amdashboard.actorsfirst
            and ascncoaclean.lastname = amdashboard.actorslast)
      where exists (select id, firstname, lastname, listingspousename,
                           add1, add2, city, state, zip, zip4, y2007, y2008,
                           y2009, y2010, y2011, y2012, Ethnicity, Gender,
                           MaritialStatus
                      from ASCNCOAClean
                           inner join amdashboard
                           on ASCNCOAClean.firstname = amdashboard.actorsfirst
                           and ascncoaclean.lastname = amdashboard.actorslast);
  </code></pre>
  
  <p>I can't get this to work...receiving a syntax error on the first parenthesis. So, I figured I'd try on just one field. I tried this:</p>
  
  <pre><code>update amdashboard
  set ascid = (select ascncoaclean.id
           from ASCNCOAClean 
           where ASCNCOAClean.firstname = amdashboard.actorsfirst
                             and ascncoaclean.lastname = amdashboard.actorslast)
  where exists (select ascncoaclean.id
           from ASCNCOAClean 
           where ASCNCOAClean.firstname = amdashboard.actorsfirst
                             and ascncoaclean.lastname = amdashboard.actorslast);
  </code></pre>
  
  <p>This however returns and error 1242: Subquery returns more than 1 row. That seems silly. I know it's going to return more than one row...I want it to because I need to update multiple rows. </p>
  
  <p>What am I missing?</p>