DECLARE @i int set @i=0 --更新题序编号 UPDATE UserAnswer SET @i=@i+1,TestOrder=@i WHERE UserScoreID='143' //根据ID 累加更新