MySQL Forums
Forum List  »  Newbie

copy rows from a table and inserting into same table but changing one field
Posted by: Kevin Khan
Date: November 26, 2010 05:55AM

Any ideas how i can do this?

The structure of my database is

CREATE TABLE IF NOT EXISTS `Classified` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user` varchar(255) COLLATE latin1_general_ci NOT NULL,
`description` text COLLATE latin1_general_ci NOT NULL,
`link` varchar(128) COLLATE latin1_general_ci NOT NULL,
`img1` varchar(128) COLLATE latin1_general_ci NOT NULL,
`published` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1642 ;

and all i wanna do is copy all rows that have a certain email we say email1@hotmail.com and insert them back into the same table but changing the email to email2@hotmail.com
kevinkhan is offline Add to kevinkhan's Reputation Report Post Edit/Delete Message

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.