Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
mysql spring数据错误(查询)_Mysql_Sql_Spring Data - Fatal编程技术网

mysql spring数据错误(查询)

mysql spring数据错误(查询),mysql,sql,spring-data,Mysql,Sql,Spring Data,我是用Spring数据做的。我想不出这个sql语句有什么问题。这个查询是由Spring数据自动生成的。 上面说 #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 'database bit not null, designation varchar(255), e

我是用Spring数据做的。我想不出这个sql语句有什么问题。这个查询是由Spring数据自动生成的。 上面说

#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 'database bit not null, designation 
varchar(255), equipment varchar(255), hardwar' at line 1
我的问题是:

create table joborder (id bigint not null auto_increment, 
                       barPrinter bit not null, 
                       birPermit bit not null, 
                       cabling bit not null, 
                       cashDrawer bit not null, 
                       cashierPrinter bit not null, 
                       ccccods bit not null, 
                       configuration bit not null, 
                       cpu bit not null, 
                       database bit not null, 
                       designation varchar(255), 
                       equipment varchar(255), 
                       hardwareActionTaken varchar(255), 
                       hardwareOthers bit not null, 
                       hardwareRemarks varchar(255), 
                       invoiceNumber varchar(255), 
                       keyboard bit not null, 
                       kitchenPrinter bit not null, 
                       logNumber varchar(255), 
                       magneticCardReader bit not null,
                       mallInterface bit not null, 
                       menu bit not null, 
                       monitor bit not null, 
                       mouse bit not null, 
                       operatingSystem bit not null, 
                       othersActionTaken varchar(255), 
                       othersOthers bit not null, 
                       othersRemarks varchar(255), 
                       powerSupply bit not null, 
                       reportProblemTask varchar(255), 
                       scanner bit not null, 
                       softwareActionTaken varchar(255), 
                       softwareOthers bit not null, 
                       softwareRemarks varchar(255), 
                       storeLocation varchar(255), 
                       storeRepresentative varchar(255), 
                       technician varchar(255), 
                       timeIn varchar(255), 
                       timeOut varchar(255), 
                       transightECLM bit not null, 
                       transightHQ bit not null, 
                       transightPOS bit not null, 
                       uat bit not null, 
                       store_id bigint, 
          primary key (id))
使用此查询

CREATE TABLE `joborder` (
  `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
  `barPrinter` BIT(1) NOT NULL,
  `birPermit` BIT(1) NOT NULL,
  `cabling` BIT(1) NOT NULL,
  `cashDrawer` BIT(1) NOT NULL,
  `cashierPrinter` BIT(1) NOT NULL,
  `ccccods` BIT(1) NOT NULL,
  `configuration` BIT(1) NOT NULL,
  `cpu` BIT(1) NOT NULL,
  `database` BIT NOT NULL,
  `designation` VARCHAR(255) DEFAULT NULL,
  `equipment` VARCHAR(255) DEFAULT NULL,
  `hardwareActionTaken` VARCHAR(255) DEFAULT NULL,
  `hardwareOthers` BIT(1) NOT NULL,
  `hardwareRemarks` VARCHAR(255) DEFAULT NULL,
  `invoiceNumber` VARCHAR(255) DEFAULT NULL,
  `keyboard` BIT(1) NOT NULL,
  `kitchenPrinter` BIT(1) NOT NULL,
  `logNumber` VARCHAR(255) DEFAULT NULL,
  `magneticCardReader` BIT(1) NOT NULL,
  `mallInterface` BIT(1) NOT NULL,
  `menu` BIT(1) NOT NULL,
  `monitor` BIT(1) NOT NULL,
  `mouse` BIT(1) NOT NULL,
  `operatingSystem` BIT(1) NOT NULL,
  `othersActionTaken` VARCHAR(255) DEFAULT NULL,
  `othersOthers` BIT(1) NOT NULL,
  `othersRemarks` VARCHAR(255) DEFAULT NULL,
  `powerSupply` BIT(1) NOT NULL,
  `reportProblemTask` VARCHAR(255) DEFAULT NULL,
  `scanner` BIT(1) NOT NULL,
  `softwareActionTaken` VARCHAR(255) DEFAULT NULL,
  `softwareOthers` BIT(1) NOT NULL,
  `softwareRemarks` VARCHAR(255) DEFAULT NULL,
  `storeLocation` VARCHAR(255) DEFAULT NULL,
  `storeRepresentative` VARCHAR(255) DEFAULT NULL,
  `technician` VARCHAR(255) DEFAULT NULL,
  `timeIn` VARCHAR(255) DEFAULT NULL,
  `timeOut` VARCHAR(255) DEFAULT NULL,
  `transightECLM` BIT(1) NOT NULL,
  `transightHQ` BIT(1) NOT NULL,
  `transightPOS` BIT(1) NOT NULL,
  `uat` BIT(1) NOT NULL,
  `store_id` BIGINT(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=INNODB DEFAULT CHARSET=latin1;

数据库是保留的关键字

您必须像这样使用
数据库

试试这个

create table joborder (id bigint not null auto_increment, 
                       barPrinter bit not null, 
                       birPermit bit not null, 
                       cabling bit not null, 
                       cashDrawer bit not null, 
                       cashierPrinter bit not null, 
                       ccccods bit not null, 
                       configuration bit not null, 
                       cpu bit not null, 
                       `database` bit not null, 
                       designation varchar(255), 
                       equipment varchar(255), 
                       hardwareActionTaken varchar(255), 
                       hardwareOthers bit not null, 
                       hardwareRemarks varchar(255), 
                       invoiceNumber varchar(255), 
                       keyboard bit not null, 
                       kitchenPrinter bit not null, 
                       logNumber varchar(255), 
                       magneticCardReader bit not null,
                       mallInterface bit not null, 
                       menu bit not null, 
                       monitor bit not null, 
                       mouse bit not null, 
                       operatingSystem bit not null, 
                       othersActionTaken varchar(255), 
                       othersOthers bit not null, 
                       othersRemarks varchar(255), 
                       powerSupply bit not null, 
                       reportProblemTask varchar(255), 
                       scanner bit not null, 
                       softwareActionTaken varchar(255), 
                       softwareOthers bit not null, 
                       softwareRemarks varchar(255), 
                       storeLocation varchar(255), 
                       storeRepresentative varchar(255), 
                       technician varchar(255), 
                       timeIn varchar(255), 
                       timeOut varchar(255), 
                       transightECLM bit not null, 
                       transightHQ bit not null, 
                       transightPOS bit not null, 
                       uat bit not null, 
                       store_id bigint, 
          primary key (id))

您应该试试这个:并选中这个()


请尝试将数据库列名更改为其他名称,这样可能没有问题。我会的。如果它工作,我会更新你。我需要解释为什么它不工作。你使用了“数据库”这个词作为列名,所以我对所有列名都应用了回勾(`)
CREATE TABLE joborder 
(
  id BIGINT(20) NOT NULL AUTO_INCREMENT,
  barPrinter BIT(1) NOT NULL,
  birPermit BIT(1) NOT NULL,
  cabling BIT(1) NOT NULL,
  cashDrawer BIT(1) NOT NULL,
  cashierPrinter BIT(1) NOT NULL,
  ccccods BIT(1) NOT NULL,
  configuration BIT(1) NOT NULL,
  cpu BIT(1) NOT NULL,
  `database` BIT NOT NULL,
  designation VARCHAR(255) DEFAULT NULL,
  equipment VARCHAR(255) DEFAULT NULL,
  hardwareActionTaken VARCHAR(255) DEFAULT NULL,
  hardwareOthers BIT(1) NOT NULL,
  hardwareRemarks VARCHAR(255) DEFAULT NULL,
  invoiceNumber VARCHAR(255) DEFAULT NULL,
  keyboard BIT(1) NOT NULL,
  kitchenPrinter BIT(1) NOT NULL,
  logNumber VARCHAR(255) DEFAULT NULL,
  magneticCardReader BIT(1) NOT NULL,
  mallInterface BIT(1) NOT NULL,
  menu BIT(1) NOT NULL,
  monitor BIT(1) NOT NULL,
  mouse BIT(1) NOT NULL,
  operatingSystem BIT(1) NOT NULL,
  othersActionTaken VARCHAR(255) DEFAULT NULL,
  othersOthers BIT(1) NOT NULL,
  othersRemarks VARCHAR(255) DEFAULT NULL,
  powerSupply BIT(1) NOT NULL,
  reportProblemTask VARCHAR(255) DEFAULT NULL,
  scanner BIT(1) NOT NULL,
  softwareActionTaken VARCHAR(255) DEFAULT NULL,
  softwareOthers BIT(1) NOT NULL,
  softwareRemarks VARCHAR(255) DEFAULT NULL,
  storeLocation VARCHAR(255) DEFAULT NULL,
  storeRepresentative VARCHAR(255) DEFAULT NULL,
  technician VARCHAR(255) DEFAULT NULL,
  timeIn VARCHAR(255) DEFAULT NULL,
  timeOut VARCHAR(255) DEFAULT NULL,
  transightECLM BIT(1) NOT NULL,
  transightHQ BIT(1) NOT NULL,
  transightPOS BIT(1) NOT NULL,
  uat BIT(1) NOT NULL,
  store_id BIGINT(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
)
ENGINE=INNODB DEFAULT CHARSET=latin1;