Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.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错误#1064_Mysql_Sql - Fatal编程技术网

Mysql错误#1064

Mysql错误#1064,mysql,sql,Mysql,Sql,错误 SQL查询: CREATE TABLE RscCompView( RscCompViewID int( 11 ) NOT NULL AUTO_INCREMENT , RscCompID int( 11 ) DEFAULT '0' NOT NULL , req_dateTIMESTAMP( 14 ) , PRIMARY KEY ( RscCompViewID ) , KEY req_date( req_date ) , KEY RscCompID( RscCompID ) ); MySQL

错误

SQL查询:

CREATE TABLE RscCompView(
RscCompViewID int( 11 ) NOT NULL AUTO_INCREMENT ,
RscCompID int( 11 ) DEFAULT '0' NOT NULL ,
req_dateTIMESTAMP( 14 ) ,
PRIMARY KEY ( RscCompViewID ) ,
KEY req_date( req_date ) ,
KEY RscCompID( RscCompID )
);
MySQL说:文档

1064-您的SQL语法有错误;检查与您的MySQL服务器版本对应的手册,以了解使用near'(14)的正确语法, 主键(RscCompViewID), 密钥请求日期(请求日期), 第4行的RscCompID键


时间戳
数据类型不能有长度,应删除该长度,该长度将起作用

CREATE TABLE RscCompView
(
    RscCompViewID int(11) NOT NULL AUTO_INCREMENT ,
    RscCompID int(11) DEFAULT '0' NOT NULL ,
    req_date TIMESTAMP,
    PRIMARY KEY (RscCompViewID) ,
    KEY req_date (req_date) ,
    KEY RscCompID (RscCompID)
);
有关更多信息,数据类型
INT(11)
并不意味着整数的长度为11,而是指如果还指定了
ZEROFILL
,则整数值将如何在左侧用零填充。有符号整数的范围值为
-2147483648到2147483647
,而无符号整数的范围值为
0到4294967295

考虑下面的例子

INT(3)      INT(3) ZEROFILL
1           001
10          010
100         100

谢谢,完成了!!伟大的帮助我亲爱的再次感谢!!!请参阅我的最新答案。