gpt4 book ai didi

mysql - SQL建表语法错误

转载 作者:行者123 更新时间:2023-12-01 00:12:53 25 4
gpt4 key购买 nike

您好,我正在尝试更加熟悉 SQL,我正在使用 MySql 来测试我的 SQL 查询。我似乎在这条语句中遇到了语法错误:

CREATE TABLE dog
(
id int(11) NOT NULL auto_increment,
name varchar(255),
descr text,
size enum('small','medium','large'),
date timestamp(14),
PRIMARY KEY (id)
)ENGINE = InnoDB;

错误:

#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 '(14), PRIMARY KEY (id) )ENGINE = InnoDB' at line 7

我在这里做错了什么?

最佳答案

试试这样说

CREATE TABLE dog

(
id int NOT NULL auto_increment,
name varchar(255),
descr text,
size enum('small','medium','large'),
date timestamp,
PRIMARY KEY (id)
)
ENGINE = InnoDB;

关于mysql - SQL建表语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12951921/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com