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? 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 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. Link to comment https://forums.phpfreaks.com/topic/159604-solved-duplicate-rows/#findComment-841834 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.