tjhilder Posted January 5, 2006 Share Posted January 5, 2006 Hi, say you have a table called news and then a table called archives, and you want to transfer the data from news to archives, is this possible? I want to be able to transfer it by ticking the news you want transfered then clicking a button (i get all that fine) just wondering how i would go about transfering it, is it possible? thanks in advance. Quote Link to comment Share on other sites More sharing options...
LazyJones Posted January 5, 2006 Share Posted January 5, 2006 Sure is possible. Select from news -> Insert into archives -> (delete old news) Quote Link to comment Share on other sites More sharing options...
fenway Posted January 5, 2006 Share Posted January 5, 2006 Alternatively, "INSERT INTO archives SELECT * FROM news", and then "DELETE * FROM news WHERE uid<(SELECT MAX(uid) FROM archives)". Quote Link to comment Share on other sites More sharing options...
LazyJones Posted January 5, 2006 Share Posted January 5, 2006 [!--quoteo(post=333662:date=Jan 5 2006, 04:05 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Jan 5 2006, 04:05 PM) 333662[/snapback][/div][div class=\'quotemain\'][!--quotec--] Alternatively, "INSERT INTO archives SELECT * FROM news", and then "DELETE * FROM archives WHERE uid=(SELECT MAX(uid) FROM archives)". Why delete archived news I thought the basic ideas was to insert old news into archives and delete them from the news table Quote Link to comment Share on other sites More sharing options...
fenway Posted January 5, 2006 Share Posted January 5, 2006 Yeah, yeah, my bad, I fixed my previous post. Quote Link to comment 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.