Mr Chris Posted May 6, 2008 Share Posted May 6, 2008 Hi All, Say I have two identical tables: articles_one id headline text articles_two id headline text And they each have 1,000 records in them with id being the primary key for each table. Is there any way I can take articles_two and place all the records in articles_one despite them each having the same primary key id's? Thanks Link to comment https://forums.phpfreaks.com/topic/104366-merging-two-tables/ Share on other sites More sharing options...
fenway Posted May 6, 2008 Share Posted May 6, 2008 Nope... not unless you change the IDs. Link to comment https://forums.phpfreaks.com/topic/104366-merging-two-tables/#findComment-534325 Share on other sites More sharing options...
beebum Posted May 6, 2008 Share Posted May 6, 2008 Try this: INSERT INTO articles_one (headline, text) SELECT headline, text FROM articles_two); Keep in mind, this will give new IDs to the data from articles_two. Link to comment https://forums.phpfreaks.com/topic/104366-merging-two-tables/#findComment-534330 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.