SQL架构错误

时间:2015-03-17 18:28:50

标签: sql sql-server database oracle schema

我一直收到以下错误"重复列"我想知道你是否有人可以通过下面的方案告诉我这个问题。

CREATE TABLE ORDER_LINE
(ONUM INT,
PNUM CHAR(4),
CONSTRAINT OLINE_ONUM_PNUM_PK PRIMARY KEY (PNUM,ONUM),
NUMBERED_ORDERED INT,
QUOTED_PRICE DECIMAL(5,2),
PNUM CHAR(2) CONSTRAINT Parts_pNUM_FK REFERENCES Parts(SNUM,
ONUM CHAR(2) CONSTRAINT Order_oNUM_FK REFERENCES Orders(SNUM));

1 个答案:

答案 0 :(得分:0)

重命名" PNUM "和" ONUM "在最后两行中,一些新名称应该可以解决问题。

CREATE TABLE ORDER_LINE
(ONUM INT,
PNUM CHAR(4),
CONSTRAINT OLINE_ONUM_PNUM_PK PRIMARY KEY (PNUM,ONUM),
NUMBERED_ORDERED INT,
QUOTED_PRICE DECIMAL(5,2),
NEWPNUM CHAR(2) CONSTRAINT Parts_pNUM_FK REFERENCES Parts(SNUM),
NEWONUM CHAR(2) CONSTRAINT Order_oNUM_FK REFERENCES Orders(SNUM));