TheTitans Posted May 25, 2009 Share Posted May 25, 2009 Hello, I have a mysql table: locations: id, color, location, etc I have about 100 rows that have the color of red. I basically want to duplicate those rows but have the color be blue. Is there anything out there that can do this? Quote Link to comment https://forums.phpfreaks.com/topic/159604-solved-duplicate-rows/ Share on other sites More sharing options...
kickstart Posted May 25, 2009 Share Posted May 25, 2009 Hi Something like this would do it. INSERT INTO table1 (Id, Item, ItemColour) SELECT NULL, Item, 'Blue' FROM table1 WHERE ItemColour = 'Red' All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/159604-solved-duplicate-rows/#findComment-841823 Share on other sites More sharing options...
TheTitans Posted May 25, 2009 Author Share Posted May 25, 2009 Thanks for the help. Quote Link to comment https://forums.phpfreaks.com/topic/159604-solved-duplicate-rows/#findComment-841834 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.