【发布时间】:2017-07-09 18:37:58
【问题描述】:
这似乎是一个相当微不足道的问题,但我在运行以下查询时运气不佳:
create table if not exists tweet_data (
created_at DATETIME,
user_name VARCHAR(20),
retweet_count INT,
favourite_count INT,
tweet_followers_count INT,
is_retweet BOOLEAN,
tweet_source VARCHAR(256),
user_location VARCHAR(256),
tweet_mentioned_count INT,
tweet_ID VARCHAR(256) NOT NULL,
tweet_text VARCHAR(140),
UNIQUE (tweet_ID) );
当我运行它时,我收到以下错误消息:
Error Code: 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), retweet_count INT, favourite_count INT,
tweet_followers_count ' at line 3
当我将鼠标悬停在第 3 行的错误标签上时,它会显示:
Syntax error : unexpected '(' (opening parenthesis)
我相信这是一个简单的修复,任何帮助都会很棒!
【问题讨论】:
-
应该是
user_name VARCHAR(20),R和(之间没有空格 -
不是因为 (20) 中的空格和 user_name 列中的 VARCHAR 吗?
-
试过这个,不幸的是仍然得到同样的错误。将编辑以删除上面的空间。
标签: mysql syntax-error mysql-error-1064