开发者

Setting a MySQL field to another

开发者 https://www.devze.com 2023-01-24 09:02 出处:网络
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.

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消