kingent85
asked on
Mysql Multi Insert from Multi Tables
How can I write a mysql query that will insert into multiple tables from multiple tables. I know that you can select multiple tables and insert into a single one. I am trying to duplicate a customer that has an id in all of my tables. I simply want to make a copy of this customer data and update another customer. So the only thing changing is the ID.
You can also use an INSERT Trigger on the table in which you are inserting the records. The trigger will then have to insert these new values into the additional tables
ASKER
can you give me an example of a trigger statement?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>How can I write a mysql query that will insert into multiple tables from multiple tables.
You can't. A single INSERT statement will only insert into one table. You need to execute a separate
statement for each table you want to insert into.