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 ;