Home > database >  Build table always prompt 1064, don't know what went wrong
Build table always prompt 1064, don't know what went wrong

Time:09-19

Mysql is 5.5.62, phpmyadmin built table, statements below

 CREATE TABLE ` yuyuelist ` 
(` ID ` INT (10) NULL AUTO_INCREMENT,
` InDate ` DATETIME (20) NULL,
NULL ` InsuranceCompany ` VARCHAR (50),
` ToDate ` DATE NULL,
` ToTime ` VARCHAR (20) NULL,
` Name ` VARCHAR (100), NULL,
` Tel ` VARCHAR (13) NULL,
NULL ` CarBrand ` VARCHAR (50),
` Model ` VARCHAR (100), NULL,
NULL ` CarCode ` VARCHAR (50),
` Project ` VARCHAR (20) NULL,
` QTY ` TINYINT (10) NULL,
` see Colour ` VARCHAR (20) NULL,
` Source ` VARCHAR (20) NULL,
` Store ` VARCHAR (20) NULL,
` few ` VARCHAR (200), NULL,
PRIMARY KEY (` ID `))
ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;


Error below

 # 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 '(20) NULL,
` InsuranceCompany ` VARCHAR (50) NULL, ` ToDate ` DATE NULL, ` ToTime ` 'at line 1


Can you tell me what went wrong?

CodePudding user response:

 CREATE TABLE ` yuyuelist ` 
(` ID ` INT (10) NULL AUTO_INCREMENT,
` InDate ` DATETIME (6) NULL,
NULL ` InsuranceCompany ` VARCHAR (50),
` ToDate ` DATE NULL,
` ToTime ` VARCHAR (20) NULL,
` Name ` VARCHAR (100), NULL,
` Tel ` VARCHAR (13) NULL,
NULL ` CarBrand ` VARCHAR (50),
` Model ` VARCHAR (100), NULL,
NULL ` CarCode ` VARCHAR (50),
` Project ` VARCHAR (20) NULL,
` QTY ` TINYINT (10) NULL,
` see Colour ` VARCHAR (20) NULL,
` Source ` VARCHAR (20) NULL,
` Store ` VARCHAR (20) NULL,
` few ` VARCHAR (200), NULL,
PRIMARY KEY (` ID `))
ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

CodePudding user response:

What do you mean? This code is not found with me there's a difference, is to change?

CodePudding user response:

refer to the second floor samenjacky response:
what do you mean? This code is not found with me there's a difference, is to change?

 ` InDate ` DATETIME (6) NULL, 

CodePudding user response:

Indate column specifies the precision of the 20 is too big, a maximum of 6,
  • Related