It is currently Sun May 19, 2013 2:46 am

All times are UTC


You can access below Applications



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: How can I merge two MySql tables?
PostPosted: Wed Jun 02, 2010 2:26 pm 
Offline
User avatar

Joined: Wed Mar 24, 2010 6:12 am
Posts: 74
which allows those rows in table_1 to supersede those in table_2 that have a matching primary key, while still inserting rows with new primary keys.

INSERT IGNORE
INTO table_1
SELECT *
FROM table_2
;
Alternatively,
REPLACE
INTO table_1
SELECT *
FROM table_2
;
will update those rows already in table_1 with the corresponding row from table_2, while inserting rows with new primary keys.

regards
Prakash.B
Share |


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron