zonkd Posted November 5, 2008 Share Posted November 5, 2008 Is there a way to move data, something like ... (from) field1, field2, field3, field4, id IN(200, 201, 202, 203, 204) in table1 to field1, field2, field3, field4, id IN(800, 801, 802, 803, 804) in table1 I would like to move the data rather than duplicate it. Is this possible, please, Experts? Quote Link to comment https://forums.phpfreaks.com/topic/131489-moving-data-in-the-same-table/ Share on other sites More sharing options...
corbin Posted November 6, 2008 Share Posted November 6, 2008 UPDATE table SET id = id+600 WHERE (id BETWEEN 200 AND 204) Quote Link to comment https://forums.phpfreaks.com/topic/131489-moving-data-in-the-same-table/#findComment-683379 Share on other sites More sharing options...
zonkd Posted November 6, 2008 Author Share Posted November 6, 2008 That looks very good, corbin, but I don't follow the '+600' Is the number, 600, the id number of the first of the group of rows that I want to update? So if there were five rows affected, it would affect 600, 601, 602, 603, and 604? Is that how it works, please? What about another way? Could I use another field then? The columns I want to move are part of a number of articles that will appear in the month='October' student news pages. Can I stipulate that they should appear in the part of the table with the month = 'November' columns, please? Quote Link to comment https://forums.phpfreaks.com/topic/131489-moving-data-in-the-same-table/#findComment-683498 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.