错误代码:1064约束

时间:2015-10-27 16:26:07

标签: mysql mysql-error-1064

create table boat
    (bid integer not null constraint c_bid primary key,
     bname varchar(40),
     color varchar(40) 
     constraint c_color check (color in ('Red','Blue','Light Green','Yellow')));

我在使用mysql workbench的脚本上使用此sql代码,并且单词contraint为红色,并且出现错误语法错误:意外'约束'(约束)。

当我运行脚本时,我得到:

Error Code: 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 'color_c constraint check (color in ('Red','Blue','Light Green','Yellow')))' at line 5  0.000 sec

0 个答案:

没有答案