Oracle创建联合主键
先创建个表:
1)
create table test
(
sno char(12),
name char(4),
CONSTRAINT PK_test PRIMARY KEY (sno,name) -- 联合主键
);
2)
创建表之后追加联合主键:
alter table 表名add constraint pk_tab2 primary key (sno,name);
先创建个表:
1)
create table test
(
sno char(12),
name char(4),
CONSTRAINT PK_test PRIMARY KEY (sno,name) -- 联合主键
);
2)
创建表之后追加联合主键:
alter table 表名add constraint pk_tab2 primary key (sno,name);