table structure
table 1
userid username
1 joe
2 matt
table 2
userid username
1
Need to update username in table2 if user id is match table 1
like select userid from table 1 if exist in table 2 then update username in table 2 ( username fetched from table 1 )
Try it by joining the tables using
INNER JOINSQLFiddle Demo