我无法使用下面的sql指令创建表
我试图修改一些默认值,但我有相同的错误。
DROP TABLE IF EXISTS CountryLanguage;
CREATE TABLE CountryLanguage (
CountryCode TEXT NOT NULL DEFAULT '',
Lang TEXT NOT NULL DEFAULT '',
IsOfficial INTEGER NOT NULL DEFAULT '0',
Percentage NUMBER NOT NULL default '0.0',
PRIMARY KEY (CountryCode,Lang)
);
表未创建,我收到以下消息:
Static analysis:
1 errors found during the scan.
Data type not recognized. (near "NUMBER" in position 164)
SQL request: CREATE TABLE CountryLanguage ( CountryCode TEXT NOT NULL DEFAULT '', Lang TEXT NOT NULL DEFAULT '', IsOfficial INTEGER NOT NULL DEFAULT '0', Percentage NUMBER NOT NULL default '0.0', PRIMARY KEY (CountryCode,Lang) )
MySQL replied: Documentation
# 1064 - Syntax error near 'NUMBER NOT NULL default' 0.0 ',
PRIMARY KEY (CountryCode, Lang)
) 'at line 5
1条答案
按热度按时间sczxawaw1#
试试这个:
另外,注意常量数据-数字周围没有撇号(这是用于字符串的)