[英]MySQL MariaDB syntax error
#1064-您的SQL語法有誤; 檢查與您的MariaDB服務器版本相對應的手冊,以在``Nr_analizes''int NOT NULL,'AnPacienti_id'int NOT NULL,附近使用正確的語法,
這是在mySQL中運行SQL代碼時得到的。 怎么了? 對我來說,sintax看起來不錯。
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))
在這里創建帶有反Ti聲:
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))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.