我有這個疑問:MySQL中創建不起作用錯誤1064
CREATE TABLE
`rooms` (
`roomname` VARCHAR NOT NULL PRIMARY KEY,
`price` DOUBLE NOT NULL
)
ENGINE = MyISAM";
但它不工作,我得到這個錯誤:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL PRIMARY KEY, `price` DOUBLE NOT NULL) ENGINE = MyISAM"' at line 3
這裏有什麼錯?
您沒有爲varchar指定長度 –
此外,PRIMARY KEY的值始終爲NOT NULL,因此不需要NOT NULL。 –
謝謝不,我知道了 – fibi