正确的错误缺少括号错误,放置在哪里?
Right error missing parenthesis error, Where is the placement at?
为什么查询会产生右括号:错误报告-
ORA-00907: 缺少右括号
00907. 00000 - “缺少右括号”
我已经尝试了所有关于在何处放置正确括号的方法,但它不起作用。
这是我的代码:
CREATE TABLE Trips
(
Trips_ID NUMBER NOT NULL,
Date_of_Trip DATE NOT NULL,
Payment NUMBER NOT NULL,
Destination_Town VARCHAR2(50) NOT NULL,
Source_Town VARCHAR2 (50) NOT NULL,
Customer_ID NUMBER NOT NULL
CONSTRAINT Trip_pk
PRIMARY KEY (Trips_ID),
CONSTRAINT Customer_fk
FOREIGN KEY (Customer_ID) REFERENCES Customer (Customer_ID),
CONSTRAINT Owner_fk
FOREIGN KEY (Owner_ID) REFERENCES Vehicle_Owners (Owner_ID),
CONSTRAINT Payment_fk
FOREIGN KEY (Payment_ID) REFERENCES Payment (Payment_ID)
);
在“Customer_ID NUMBER NOT NULL”后添加一个逗号。这应该可以解决问题。
为什么查询会产生右括号:错误报告- ORA-00907: 缺少右括号 00907. 00000 - “缺少右括号” 我已经尝试了所有关于在何处放置正确括号的方法,但它不起作用。
这是我的代码:
CREATE TABLE Trips
(
Trips_ID NUMBER NOT NULL,
Date_of_Trip DATE NOT NULL,
Payment NUMBER NOT NULL,
Destination_Town VARCHAR2(50) NOT NULL,
Source_Town VARCHAR2 (50) NOT NULL,
Customer_ID NUMBER NOT NULL
CONSTRAINT Trip_pk
PRIMARY KEY (Trips_ID),
CONSTRAINT Customer_fk
FOREIGN KEY (Customer_ID) REFERENCES Customer (Customer_ID),
CONSTRAINT Owner_fk
FOREIGN KEY (Owner_ID) REFERENCES Vehicle_Owners (Owner_ID),
CONSTRAINT Payment_fk
FOREIGN KEY (Payment_ID) REFERENCES Payment (Payment_ID)
);
在“Customer_ID NUMBER NOT NULL”后添加一个逗号。这应该可以解决问题。