SQL 创建表中的语法错误 [英] Syntax error in SQL create table
本文介绍了SQL 创建表中的语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试更熟悉 SQL,我正在使用 MySql 来测试我的 SQL 查询.我似乎在此语句中遇到了语法错误:
Hi I am trying to get more familiat with SQL and I am using MySql to test my SQL queries.I seem to be getting a sintax error in this statement:
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 - 您的 SQL 语法有错误;检查手册对应于您的 MySQL 服务器版本以使用正确的语法在第 7 行靠近 '(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;
这篇关于SQL 创建表中的语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文