1楼,他说的是id=identity(int,1,1)么?

解决方案 »

  1.   

    1楼,他说的是id=identity(int,1,1)么?
      

  2.   

    楼主是指每增加一列,然后id列自动加1么?要是
    1.在你的表中直接加id列(当然是允许的情况下)
    alter table tablename add id int identity(1,1)not null
    2.临时表
    select id=identity(int,1,1),* into temp from tablename
    select * from temp
    drop table tablenameoracle没用过,见笑!
      

  3.   

    如果不可以唯一区分没条记录是没有办法的,在可以唯一区分每条记录的时候,可以:select t.*,(select count(*) from table t2 where t2.if<=t.id)
    from table t
      

  4.   

    select t.*,(select count(*) from table t2 where t2.id<=t.id)
    from table t