MySQL Forums
Forum List  »  MySQL Query Browser

Re: merging tables
Posted by: Chad Bourque
Date: April 21, 2010 08:51AM

John,

You can add a unique index on the phone1 column. Then, you can do an insert into ... select ... on duplicate key update ... Or you can do an insert ignore ... In either case, just omit the primary key column and pretend the phone1 column is the primary key for the merge.

You could also do an insert select where you only select the rows from one table that aren't in the other table. You can do that by joining the tables or using an in subquery. The join will be faster.

HTH,
Chad

Options: ReplyQuote


Subject
Written By
Posted
April 21, 2010 07:48AM
Re: merging tables
April 21, 2010 08:51AM
April 22, 2010 02:10AM
April 22, 2010 08:06AM
April 22, 2010 08:18AM


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.