jason1990
CREATE TABLE IF NOT EXISTS `change` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `creator` VARCHAR(45) NOT NULL,
  `description` VARCHAR(2048) NULL,
  `supervisor` VARCHAR(45) NOT NULL,
  `created_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `planed_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `executor` VARCHAR(45) NOT NULL,
  PRIMARY KEY (`id`))
ENGINE = InnoDB

以上为change的建表语句.

insert into change (creator, description, supervisor, executor) values (\'1111\', \'1\', \'111\', \'111\');

执行以上insert操作时,报SQL执行错误 #1064错误.
误以为时sql语句书写错误,检查良久之后确认无误.
突然联想到change可能是mysql保留字,网上搜索后验证猜想.
因此,对change保留字添加反引号解决.

insert into `change` (creator, description, supervisor, executor) values (\'1111\', \'1\', \'111\', \'111\');

PS:
如果您觉得我的文章对您有帮助,可以扫码领取下红包,谢谢!

分类:

技术点:

相关文章:

  • 2021-11-17
  • 2021-11-17
  • 2021-05-05
  • 2021-11-17
  • 2021-12-15
  • 2021-11-17
  • 2021-10-12
  • 2021-11-17
猜你喜欢
  • 2021-11-17
  • 2021-11-17
  • 2021-11-17
  • 2021-11-17
  • 2021-11-17
  • 2021-11-17
  • 2021-11-17
相关资源
相似解决方案