我知道这个题目有很多问题,但我在这里没有发现我的错误。我刚刚开始学习SQL。
我的问题是:
CREATE TABLE IF NOT EXISTS `data` (
`id` int(11) NOT NULL auto_increment,
`quizid` int(11) NOT NULL default '0',
`result` int(3) NOT NULL default '0',
`IP` varchar(16) NOT NULL default '',
`ts` timestamp(14) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB ;错误:
#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 '(14) NOT NULL,
PRIMARY KEY (`id`)' at line 6我知道答案一定很容易被右眼发现。
发布于 2013-12-01 04:53:44
timestamp不接受CREATE TABLE子句中的长度
发布于 2013-12-01 04:59:13
timestamp接受长度,但直到6精度数字。但是,您不必为timestamp指定长度
https://stackoverflow.com/questions/20308849
复制相似问题