我输入以下内容:
CREATE TABLE events (
`id` mediumint unsigned not null auto_increment,
`user` varchar(30) not null,
`time` datetime not null,
`duration` decimal(5,2) default 1.0,
`title` tinytext not null,
`location` text default null,
`tag` ENUM(‘red’,’orange’,’yellow’,’green’,’blue’,’violet’,’brown’,’black’) default null,
PRIMARY KEY (`id`),
FOREIGN KEY (`user`) references users (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
我得到以下回应:
ERROR 1064 (42000): 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 '‘red’,’orange’,’yellow’,’green’,’blue’,’violet’,’brown' at line 8
这可能是眼睛疲劳的情况,但是我很沮丧。我的enum语句有什么问题?
改变:
`tag` ENUM(‘red’,’orange’,’yellow’,’green’,’blue’,’violet’,’brown’,’black’)
至:
`tag` ENUM('red', 'orange','yellow','green','blue','violet','brown','black')
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句