create table test (id varchar(5) primary key,price number(4,2));

解决方案 »

  1.   

    create table test (id varchar(5),price number(4,2), primary key (id));
      

  2.   

    create table test (id varchar(5),price number(4,2)) primary key id;
                                                              ---(有空格) 
      

  3.   

    如果表已经创建完,则
    ALTER TABLE 表名 ADD CONSTRAINT 主键名 PRIMARY KEY(列1,列2...)
      

  4.   

    create table test (id varchar(5) primary key,price number(4,2));
      

  5.   

    呵呵,我早就领教了。
    BZSZP好象总泡在网上似的。
    不过象这些太基础的贴子,建议贴主还是多看看书,如果真的想学的东西的话,还是要看书的。