MySQL Forums
Forum List  »  Triggers

Re: DB to DB updating
Posted by: Peter Brawley
Date: July 01, 2011 11:05AM

> UPDATE DB2.Table.Field WITH DB1.Table.Field WHERE DB2.Table.Field <> DB1.Table.Field

Bad syntax and logic both.

> How would I best update DB2.Table.Field with DB1.Table.Field so that any data from DB1 that is not in DB2 will be added to DB2?

You want all rows and columns in tb2.table to match all rows & columns in db1?

truncate db2.table;
insert into db2.table select * from db1.table;

PB

Options: ReplyQuote


Subject
Views
Written By
Posted
2140
June 30, 2011 05:04PM
Re: DB to DB updating
949
July 01, 2011 11:05AM


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.