declear ttt intset ttt = select count(*) from 表
for i:=1 to ttt
begin
  table.序号=i;
  table.update;
end;

解决方案 »

  1.   

    declare @i int
    set @i=0
    update 表 set @i=@i+1,序号=@i
      

  2.   

    declear @ttt intset @ttt = select count(*) from 表
    for i:=1 to ttt
    begin
      table.序号=i;
      table.update;
    end;
      

  3.   

    declare @i int
    set @i=0
    update 表 set 序号=@i=@i+1
      

  4.   

    declare @i int
    set @i=0
    update 表 set @i=序号,序号=@i+1
      

  5.   

    结了贴也有一个话题:
    to:netcoder(数据猪)
    你为什么说表中的记录是没有上下之分的,
    如果如你所说,那么我用
    select identity(int 1,1),* into #table from table
    结果有会如何呢?