Page 1 of 1
How do you copy one field to another - copy NOT move?
Posted: Fri May 21, 2010 9:49 am
by simonmlewis
I want to copy the contents of one field in all rows, to another field. ie. Category to be copied into Catname.
I have tried this:
Code: Select all
UPDATE [yourTable] SET `cost` = `salesprice`;
But all it does is to MOVE it. Category ended up empty!!
What's the method??
Re: How do you copy one field to another - copy NOT move?
Posted: Fri May 21, 2010 9:56 am
by mikosiko
Re: How do you copy one field to another - copy NOT move?
Posted: Fri May 21, 2010 11:01 am
by simonmlewis
UPDATED: APOLOGIES: your code is the other way around. I did it the wrong way didn't I. WILL TRY NOW.
Sorry but as my original post states, that code MOVES the data to the other field, it does not COPY it.
I need to copy it - so the same contents are in TWO fields.
Re: How do you copy one field to another - copy NOT move?
Posted: Fri May 21, 2010 11:03 am
by simonmlewis
Bingo thanks.
Logical really. Durr!!