alter table a add (temp number(10))
alter table a add primary key (temp)

解决方案 »

  1.   

    alter table a add constraint tem_key primary key(temp);
    or
    alter table a add primary key (temp);
    下面是直接增加,不需要加括号:
    SQL> create table testf (a varchar2(20));Table createdSQL> alter table testf add b number primary key;Table altered
      

  2.   

    楼主不会要再字段类型为number的列上做主键巴
      

  3.   

    to zhaokeke2004(/ ***** 大力·I.A.M *****/)
    在数字列上做主键有什么关系吗?
      

  4.   

    alter table a add constraint tem_key primary key(temp);