1、用户A表的某一列更新B表的某一列
eg:用t2表的c_account_id替换t1表的c_counter_part_id字段
update t_invest_account_cashflow t1 set
t1.c_counter_part_id=(select t2.c_account_id from
t_invest_account t2 where
t1.c_invest_account_id=t2.c_invest_account_id )
2、产生自增编号
rowNum将从1开始自增
set @row=0;
select c_account_cashflow_id ,@row:=@row+1 rowNum
from t_account_cashflow where
c_account_cashflow_id ;