同时包含两个主键是不可以的。只能是一个主键,主键包含两个字段。同时都是外键。
create table pdm_bomdetail_tb (
id_bom int not null,
id_version int not null,
part_id_bom int null,
qty numeric(18,4) not null,
id_user int null,
create_date datetime null,
constraint pdm_bomdetail_pk primary key (id_bom, id_version),
constraint pdm_bomdetail_idbom_fk foreign key (id_bom)
references pdm_bom_tb (id_bom),
constraint pdm_bomdetail_idpart_fk foreign key (id_version)
references pdm_partversion_tb (id_version)
)