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

Posted by David Smithz on 02/20/07 20:38

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.

 

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

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