gpt4 book ai didi

MySQL MariaDB 语法错误

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

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''Nr_analizes' int NOT NULL, 'AnPacienti_id' int NOT NULL,

这是我在 mySQL 中运行 SQL 代码时得到的结果。怎么了?语法对我来说看起来不错。

CREATE TABLE Analiza_laboratorike(
'Nr_analizes' int NOT NULL,
'AnPacienti_id' int NOT NULL,

'Lloji_analizes' varchar(15) NOT NULL,
'Kategoria_pacientit' varchar(15) NOT NULL,
PRIMARY KEY(Nr_analizes),
FOREIGN KEY(AnMjeku_id) REFERENCES Mjeku(Mjeku_id),
Foreign KEY(AnPacienti_id) REFERENCES Pacienti(Pacienti_id))

最佳答案

列或表名称不应包含在撇号中:

CREATE TABLE Analiza_laboratorike(
Nr_analizes int NOT NULL,
AnPacienti_id int NOT NULL,

Lloji_analizes varchar(15) NOT NULL,
Kategoria_pacientit varchar(15) NOT NULL,
PRIMARY KEY(Nr_analizes),
FOREIGN KEY(AnMjeku_id) REFERENCES Mjeku(Mjeku_id),
Foreign KEY(AnPacienti_id) REFERENCES Pacienti(Pacienti_id))

关于MySQL MariaDB 语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35385195/

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