Setting a MySQL field to another
I have a MySQL field called description
and a field called specs
. They need to be the 开发者_如何学JAVAsame, but I only have specs
filled out.
Can I do something like: Update products set description = specs;
?
Using:
UPDATE PRODUCTS
SET description = specs
...will set the description
value to the same value as in the specs
column, on a row by row basis for every row in the table. Is that what you want for every record?
Why do you want to store redundant data in the description
column? Why not use only the specs
column, and drop the description
column from the table?
精彩评论