How-to copy a column

2005-01-31 Thread Syed Ali
Does anyone know the easiest way to copy a column in mysql? 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. I guess one possible way is to do a select and output

RE: How-to copy a column

2005-01-31 Thread Tom Crimmins
[snip] Does anyone know the easiest way to copy a column in mysql? 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. [/snip] UPDATE table1 SET col2=col1; --- Tom

Re: How-to copy a column

2005-01-31 Thread Joerg Bruehe
Hi! Am Mo, den 31.01.2005 schrieb Syed Ali um 17:14: Does anyone know the easiest way to copy a column in mysql? 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

Re: How-to copy a column

2005-01-31 Thread beacker
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