MySQL Forums
Forum List  »  General

UPDATE multiple tables with one UPDATE statement
Posted by: Anthony Linhardt
Date: April 26, 2006 12:38PM

I need assistance on how to UPDATE multiple tables with one statement. For example: I have 2 tables Table A, and Table B. Each table has different columns except for the primary key. How would I go about writing the statement as one statement? I looked into the documentation and read about updating multiple tables, but it seems that the example in the documentation is about updating multiple tables with the same columns. Am I wrong on this and not understanding it right?

Table A
id
FirstName
LastName

Table B
id
CompanyName
CompanyAddress

How would you do a single UPDATE to populate both tables with the necessary data?

Options: ReplyQuote


Subject
Written By
Posted
UPDATE multiple tables with one UPDATE statement
April 26, 2006 12:38PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.