[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql
Subject:    Re: How-to copy a column
From:       beacker () misc ! com
Date:       2005-01-31 18:35:32
Message-ID: 200501311835.j0VIZXba003123 () ns ! misc ! com
[Download RAW message or body]

>I have a table (table1) which has 4 columns, I want to copy all the
>contents of col1 into col2. 
>Col3 is the primary unique key, so the copy has to keep the data matched
>with col3.

     Sounds like what you want to do is

	update table1 set col2 = col1;

which will copy the contents of col1 in each record to col2.
               Brad Eacker (beacker@misc.com)



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=mysql@progressive-comp.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic