Mysql使用update...inner join和select更新数据
Mysql使用update...innerjoin更新数据
UPDATE table_A INNER JOIN table_A_bak ON table_A.code_id = table_A_bak.code_id SET table_A.code_text=table_A_bak.code_text WHERE table_A.code_filename='';
使用update...select更新数据
update t_tbl_desc set num=b.num from t_tbl_desc a, (select distinct(name) as name,count(name) num from t_col_desc group by name)b where a.name=b.name