Unix Technical Forum

Moving data from one column to another

This is a discussion on Moving data from one column to another within the MySQL forums, part of the Database Server Software category; --> ....still a bit new to sql/mysql. ....not sure what to search under yet for the following task: ...perhaps someone ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 09:43 AM
Jeff
 
Posts: n/a
Default Moving data from one column to another


....still a bit new to sql/mysql.

....not sure what to search under yet for the following task: ...perhaps
someone would be kind enough
to provide the correct command

....trying to move the value of one column to another column within the same
table.

e.g., if column1 = 6 and column2 = 9 to start and I move column1 to column2

the result should be that column 2 = 6 and column 1 can remain at 6.

Thanks

Jeff


--
Posted via a free Usenet account from http://www.teranews.com

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 09:43 AM
amygdala
 
Posts: n/a
Default Re: Moving data from one column to another


"Jeff" <none@nothingX.com> schreef in bericht
news:4637e914$0$16371$88260bb3@free.teranews.com.. .
>
> ...still a bit new to sql/mysql.
>
> ...not sure what to search under yet for the following task: ...perhaps
> someone would be kind enough
> to provide the correct command
>
> ...trying to move the value of one column to another column within the
> same table.
>
> e.g., if column1 = 6 and column2 = 9 to start and I move column1 to
> column2
>
> the result should be that column 2 = 6 and column 1 can remain at 6.
>
> Thanks
>
> Jeff
>
>
> --
> Posted via a free Usenet account from http://www.teranews.com
>


UPDATE foo SET column2 = column1 WHERE column1 = 6 AND column2 = 9;

HTH


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:21 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com