mysql的关键字

在mysql中建表的时候,或者用PowerDesigner生成数据库的时候如果表名是mysql的关键字
则会报下面类似的错,
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 'condi
tion'
而生成的sql文件里面condition被打双引号标红,
具体的mysql表的关键字 http://www.cnblogs.com/lawdong/archive/2010/08/08/2357903.html
如果排除是关键字的问题则有可能是因为自增长的字段必须是主键


Mysql建表遇关键字的问题:
加这个号`,不是单引号。就是键盘上esc下面,数字1左边那个键。

上面是一个波浪号,下面是那个点的符号。

create table c(id char(20) not null primary key,`index` char(10));

猜你喜欢

转载自cindyliao.iteye.com/blog/2233697