Re: mySQL - Swap data in a field between two rows

From: Date: Sat, 17 Mar 2001 17:13:38 +0000
Subject: Re: mySQL - Swap data in a field between two rows
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-44403@lists.php.net to get a copy of this message
I don't mean to be argumentative, but why would you need to do this? A key field is usually intended to uniquely identify a row and nothing more, the actual value of the key (whether the id is 1 or 2) *should* be immaterial. I'm probably over simplifying this, but are you sure you really need to do this? Regards, Gary H. ""Vincent P. Cocciolone"" <Vince@QuatraMedia.com> wrote in message news:001001c0aeff$ce098dc0$eafe8318@mw.mediaone.net... > There must be an easy way, but it escapes me. > > How can I switch the data in a feild of one row with the data in that field of > another row? > > example: > row: id=1 fname=John lname=Doe > row: id=2 fname=Mary lname=Poppins > to: > row: id=2 fname=John lname=Doe > row: id=1 fname=Mary lname=Poppins > Thanks... > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#44403) next »