rantsh Posted January 31, 2007 Share Posted January 31, 2007 Is there any way I can merge the records of two tables/views that have the same columns but are separate. (I know it wasn't a smart move two have 2 tables of the same, but it was like that when I got here) thx Quote Link to comment https://forums.phpfreaks.com/topic/36521-merging-2-tables/ Share on other sites More sharing options...
ShogunWarrior Posted January 31, 2007 Share Posted January 31, 2007 INSERT INTO table2 SELECT * FROM table1 I believe. Quote Link to comment https://forums.phpfreaks.com/topic/36521-merging-2-tables/#findComment-173881 Share on other sites More sharing options...
rantsh Posted January 31, 2007 Author Share Posted January 31, 2007 Well yes, I guess I screwed up when I asked... I meant temporarily merge, just for a query.... something like select * from t1; select * from t2; Quote Link to comment https://forums.phpfreaks.com/topic/36521-merging-2-tables/#findComment-173884 Share on other sites More sharing options...
fenway Posted January 31, 2007 Share Posted January 31, 2007 You mean UNION? Quote Link to comment https://forums.phpfreaks.com/topic/36521-merging-2-tables/#findComment-173993 Share on other sites More sharing options...
rantsh Posted February 2, 2007 Author Share Posted February 2, 2007 maybe... I don't really know how it's called Quote Link to comment https://forums.phpfreaks.com/topic/36521-merging-2-tables/#findComment-175295 Share on other sites More sharing options...
fenway Posted February 2, 2007 Share Posted February 2, 2007 That's how it's called... just wrap each query in parens, and add "UNION ALL" between them.. assuming the structures are identical. Quote Link to comment https://forums.phpfreaks.com/topic/36521-merging-2-tables/#findComment-175322 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.