SQL Error - missing keyword

一笑奈何 提交于 2019-12-07 22:09:08

问题


Whats wrong with this query : I am getting following error

SQL Error: ORA-00905: missing keyword 00905. 00000 - "missing keyword"

it says error at 4th row. Please advise

CREATE TABLE ORDERS
(
ID INT        NOT NULL,
ord_date    DATE, 
AMOUNT     double,
CUSTOMER_ID INT references CUSTOMERS(ID),
PRIMARY KEY (ID)
);

回答1:


You missed to add precision in double datatype

CREATE TABLE ORDERS
(
   ID INT        NOT NULL,
   ord_date    DATE, 
   AMOUNT     double precision,
   CUSTOMER_ID INT references CUSTOMERS(ID),
   PRIMARY KEY (ID)
);

SQLFIDDLE DEMO

For more info check here




回答2:


You can use BIGINT or DECIMAL type for double type.



来源:https://stackoverflow.com/questions/28522646/sql-error-missing-keyword

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!