gpt4 book ai didi

mysql - 无法解决 MySQL 错误 #1064

转载 作者:行者123 更新时间:2023-11-29 22:23:15 25 4
gpt4 key购买 nike

据我所知,我的查询似乎没问题:

CREATE TABLE PORTAL_NOTES (
id numeric NOT NULL,
school_id numeric,
syear numeric(4,0),
title character varying(255),
content character varying(5000),
sort_order numeric,
published_user numeric,
published_date timestamp(0),
start_date date,
end_date date,
published_profiles character varying(255)
);

但我收到此错误:

#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 '(1) , start_date date, end_date date, published_profiles characte' at line 9

谁能帮我调试这里的问题吗?

最佳答案

试试这个:

CREATE TABLE PORTAL_NOTES (
id numeric NOT NULL,
school_id numeric,
syear numeric(4,0),
title character varying(255),
content character varying(5000),
sort_order numeric,
published_user numeric,
published_date timestamp,
start_date date,
end_date date,
published_profiles character varying(255)
);

问题是因为您在 timestamp(0) 中设置了长度,这不需要长度。

关于mysql - 无法解决 MySQL 错误 #1064,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30522870/

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