我正在将一个sql文件导入MySQL
数据库,但是在此表中出现错误后导入了半个表:
DROP VIEW IF EXISTS `v_deals`;
CREATE TABLE `v_deals` (
`LocationCode` VARCHAR(6) NOT NULL DEFAULT '',
`LocationName` VARCHAR(50) NOT NULL,
`LocationTypeID` INT(11) NOT NULL,
`Address` VARCHAR(50) NOT NULL DEFAULT '',
`City` VARCHAR(40) NOT NULL DEFAULT '',
`Province` VARCHAR(4) NOT NULL DEFAULT '',
`TelephoneNumber` VARCHAR(20) NULL DEFAULT NULL,
`www` VARCHAR(50) NULL DEFAULT NULL,
`eMail` VARCHAR(40) NULL DEFAULT NULL,
`LocationDescription` VARCHAR(256) NULL DEFAULT '',
`ZipCode` VARCHAR(10) NOT NULL DEFAULT '',
`Latitude` DOUBLE(10) NOT NULL,
`Longitude` DOUBLE(10) NOT NULL,
`NumberRating` BIGINT(20) NULL DEFAULT NULL,
`PercentRating` DECIMAL(33) NULL DEFAULT NULL,
`Miniatura` VARCHAR(255) NULL DEFAULT NULL,
`Title` VARCHAR(30) NOT NULL DEFAULT '',
`SubTitle` VARCHAR(50) NULL DEFAULT '',
`Text` VARCHAR(512) NOT NULL DEFAULT '',
`PhotoUrl` VARCHAR(255) NULL DEFAULT '',
`Created` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
`CountryCode` VARCHAR(2) NULL DEFAULT NULL,
`DealsID` INT(11) NOT NULL DEFAULT '0'
) 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,
`Longitude` DOUBLE(10) NOT NULL,
`NumberRating` BIGINT(20) N' at line 13
答案 0 :(得分:1)
对于DOUBLE类型的列,您应该提供您想要的十进制数Ex:DOUBLE(10,2)