这个就简单了
set @r:=0;update t_communicate_plan set id=(@r:=@r+1);
定义变量, 根据表进行更新.
来源: http://www.bubuko.com/infodetail-2603120.html