You are here: Re: Swapping values in mysql fields - possible (easy)? « PHP SQL « IT news, forums, messages
Re: Swapping values in mysql fields - possible (easy)?

Posted by Paul Lautman on 02/20/07 21:10

David Smithz wrote:
> Hi
>
> I have an mysql table.
>
> For particular set of rows I want to swap two of the values.
>
> So it would be something like
>
> update exampletable set
> field1= field 2
> field 2= field1
> where field3=value
>
> Is this possible? I was worried that doing this might make both the
> values the same because by time you get to
> field2 = field1, the value in field 1 has changed and that data is
> lost?
> this is using mysql.
>
> Thank in advance for any input.

If you are worried, why not try it out on a test table and see what happens?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация