2016-05-12 3 views
0

存在しない場合、私はテーブルを持って、列descriptiondescription_shortproductsは、いくつかのも、両方が満たされている場合があります。だから私がしたいのは、descriptionのすべてをdescription_shortにコピーすることです。description_shortは空です。のMySQL挿入

MySQLでこれを行う最も簡単な方法は何ですか?

答えて

0

それは簡単です:

update products 
set description = description_short 
where description is null; 

commit; 

update products 
set description_short = description 
where description_short is null; 

commit; 
0
update table_name 
set description_short =description 
where description_short is null and description is not null