gpt4 book ai didi

mysql - SQL语法创建表

转载 作者:行者123 更新时间:2023-11-29 14:50:30 25 4
gpt4 key购买 nike

以下创建表的 SQL 有什么问题?它在MySQL中执行

CREATE TABLE friend_recommend(
UID VARCHAR2(10) NOT NULL,
FID VARCHAR2(10) NOT NULL,
MID VARCHAR2(10) NOT NULL,
DATE TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (UID, FID, MID)
)

错误是:

#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 'VARCHAR2(10) NOT NULL, FID VARCHAR2(10) NOT NULL, MID VARCHAR2(10) NOT NUL' at line 2

<小时/>

最佳答案

什么是 VARCHAR2?
尝试将其更改为 VARCHAR

CREATE TABLE friend_recommend(
UID VARCHAR(10) NOT NULL,
FID VARCHAR(10) NOT NULL,
MID VARCHAR(10) NOT NULL,
DATE TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (UID, FID, MID)
)

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

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