如何创建多个主键

来源:百度知道 编辑:UC知道 时间:2024/05/11 13:19:43
create table 药库药品结存(
kf_no char(2) , /*一级药品库编码*/
yp_code char(12) , /*药品编码*/
ph char(10) , /*批号*/
jc_date date , /*药品结存日期*/
yp_qc_amount numeric(8,2), /*药品期初结存数量*/
yp_qc_cost numeric(9,2), /*药品期初结存金额*/
yp_rk_amount numeric(8,2), /*药品入库数量*/
yp_rk_cost numeric(9,2), /*药品入库成本*/
yp_ck_amount numeric(8,2), /*药品出库数量*/
yp_ck_cost numeric(9,2), /*药品出库成本*/
yp_jc_amount numeric(8,2), /*药品结存数量*/
yp_jc_cost numeric(9,2), /*药品结存金额*/
yp_pc_amount numeric(8,2), /*药品盘存数量*/
yp_pc_cost numeric(9,2), /*药品盘存金额*/
constraint PK_ypjc primary key (kf_no,yp_code,ph,jc_date),
constraint FK_yp_code1 foreign key (yp_code) references 药品(yp_code),
constraint FK_ph1 foreign key (ph) references 药品(ph));
这段代码有错 高手帮帮忙……

开过了大农场,影子小小的牛群,
镜中是星期天,
向我的老母亲
所以为了你的脸我就交换了所有的脸
生活是处于月亮引力下大海的颤动
晚秋静静的离中,在寒霜的早晨。哈哈