mysql 语句问题 10
CREATETABLEblogentries(blog_idINT(100)PRIMARYKEY,author_idINTREFERENCESauthor(author_...
CREATE TABLE blogentries
(
blog_id INT(100) PRIMARY KEY,
author_id INT REFERENCES author (author_id),
title TEXT NOT NULL,
description TEXT,
TYPE NVARCHAR(10) NOT NULL,
allowcomment CHAR(1) NOT NULL,
markprivate CHAR(1) NOT NULL,
body TEXT NOT NULL,
datecreated TIMESTAMP ,
datepublish TIMESTAMP ,
datemodified TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
islock CHAR(1),
blogtype_id INT REFERENCES blogotypes(blogtype_id),
)
这句话有什么问题
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 ')' at line 17
这是报错提示 展开
(
blog_id INT(100) PRIMARY KEY,
author_id INT REFERENCES author (author_id),
title TEXT NOT NULL,
description TEXT,
TYPE NVARCHAR(10) NOT NULL,
allowcomment CHAR(1) NOT NULL,
markprivate CHAR(1) NOT NULL,
body TEXT NOT NULL,
datecreated TIMESTAMP ,
datepublish TIMESTAMP ,
datemodified TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
islock CHAR(1),
blogtype_id INT REFERENCES blogotypes(blogtype_id),
)
这句话有什么问题
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 ')' at line 17
这是报错提示 展开
1个回答
展开全部
需要写成:
datecreated TIMESTAMP default 0,
datepublish TIMESTAMP default 0,
datemodified TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
或者尝试:
datecreated TIMESTAMP default CURRENT_TIMESTAMP,
datepublish TIMESTAMP default 0,
datemodified TIMESTAMP DEFAULT 0 ON UPDATE CURRENT_TIMESTAMP,
datecreated TIMESTAMP default 0,
datepublish TIMESTAMP default 0,
datemodified TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
或者尝试:
datecreated TIMESTAMP default CURRENT_TIMESTAMP,
datepublish TIMESTAMP default 0,
datemodified TIMESTAMP DEFAULT 0 ON UPDATE CURRENT_TIMESTAMP,
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询