rkeith2412
asked on
MySQL complex update
Ok, let's see if I can expalin what I want. Basically I have three tables called record, records, and users. I am migrating data from record to records which is layed out a little better with less data being duplicated.
I need to read users.id where record.supEmpNum = users.empNum and update records.supID with the returned data where record.id = records.id
I need to read users.id where record.supEmpNum = users.empNum and update records.supID with the returned data where record.id = records.id
ASKER
I am looking to update, I already have an insert using the same field in the users table.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
yes I did, I had moved on to the syntax of the update statement at http://dev.mysql.com/doc/refman/5.0/en/update.html
ASKER
I was really close, thanks for the help.
I put a syntax suggestion above also, which should help also.
assuming it's a UPDATE, consider reading this article that explains, though not for MySQL alone, how to build up the UPDATES with JOINS:
https://www.experts-exchange.com/articles/Database/Miscellaneous/UPDATES-with-JOIN-for-everybody.html