我正在尝试创建一个名为“cartable”的 sql 表。我目前正在通过 MAMP(Mac 版本的 WAMP)使用 phpmyadmin。
当我单击保存按钮时,会出现此错误:
SQL query:
CREATE TABLE `cardatabase`.`CARTABLE` (
`ID` VARCHAR( 10 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`SLOTNUMBER` VARCHAR( 10 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`STATUS` ENUM( 1 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`LATITUDE` DECIMAL( 20 ) NOT NULL ,
`LONGITUDE` DECIMAL( 20 ) NOT NULL ,
`LOCATION` VARCHAR( 40 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`DEVICEID` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci;
MySQL said: Documentation
#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 '1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `LATITUDE` DECIMAL(20) N' at line 1
双数据类型似乎是一个问题,因为当我将其更改为 varchar 时,表已创建。还有其他方法吗?在此先感谢,非常感谢任何帮助。