各位大神好,小弟今天在操作mysql插入数据时,碰到一个问题,百思不得其解,所以来SF请教一下各路大神。
表结构如下:
创建该表SQL语句如下:
CREATE TABLE `test_env` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`describe` varchar(11) NOT NULL,
`detail` varchar(11) NOT NULL,
`title` varchar(11) NOT NULL,
`type` int(11) NOT NULL,
`create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
下面问题来了
我使用insert语句插入一条记录,但是一直提示我语法错误
insert into test_env (describe, detail, title, type)
values ('11', '22', '33', 0);
提示
如果我使用下面的insert语句则没有错误
insert into test_env (`describe`, `detail`, `title`, `type`)
values ('11', '22', '33', 0);
请问各位大神这是怎么回事,我之前在filed名上不加 ``符号也没问题。
因为
describe
是mysql保留的关键字,用来描述表结构的