在Oracle数据中用多个字段确定 一条唯一的记录 在无主键的表中这样的表怎么创建??

解决方案 »

  1.   

    这就是联合主键呀,将多个字段联合起来指定为主键Create Table 表名 (字段名1 Int Not Null,
                        字段名2 nvarchar(13) Not Null Primary Key (字段名1, 字段名2),
                        字段名3…………
                        字段名N………… )
      

  2.   

    建立联合主键:主键由几个字段构成
    create table tablename (  
       字段名1 varchar2(20), 
       字段名2 varchar2(10), 
        .....
       字段名n………… ,
       Primary Key (字段名1, 字段名2,....)
    );
      

  3.   

    create unique index idx_name on table_name(field1_name,field2_name,...);