alter table 原表 add uid int identity(1,1)

解决方案 »

  1.   

    ORCAL 的建议楼主转版,不会
      

  2.   

    先发错地方了,我用这个改表在ORCAL里面好象不成功,谢谢。怎么写呢?
      

  3.   

    楼上...? 这.....这是怎么回事?如果只要一个序列的话,就建视图好了.select rownum uid,name,age from table;
      

  4.   

    chris_crow是个疯子,不要理它。我不要建视图啊,我要改表啊。。
      

  5.   

    每条记录的编号,只要有新的记录,id号就自动加1用序列来实现
    --建序列:
    create sequence seq_name
    increment by 1
    start with 1
    maxvalue 99999999999
    nocycle
    cache 10--调用:
        insert into table(id,name) values(seq_name.nextval,'名字');这样可以不??
      

  6.   

    oracle中的字增和sql server中的不同.oracle中是sequence 来实现自增的目的的:--先建一序列
    create sequence seq_name 
    increment by 1
    start with 1
    maxvalue 99999999
    nocycle
    cache 10--修改表结构
    alter table add(p_id number(10));--然后在数据操作的过程中或语句或触发器中,这么调用:
    insert into tablea(p_id,...) values(seq_name.nextval,.....);