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 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. 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; 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? 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 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. Link to comment https://forums.phpfreaks.com/topic/36521-merging-2-tables/#findComment-175322 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.