MySQL 1064 创建链接时出错 Table(多对多)
MySQL 1064 Error Creating a Linking Table (Many-to-Many)
我试图理解为什么使用以下代码会发生解析错误 (1064)。
<#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 '' at line 3>
CREATE TABLE Party_Library
(
Party INT(11)
Library varchar(40)
PRIMARY KEY (Library,Party)
FOREIGN KEY (Party) REFERENCES Party(PartyKey) ON DELETE CASCADE
FOREIGN KEY (Library) REFERENCES MusicLibraries(MusicSource) ON DELETE CASCADE
)
每个声明后都缺少逗号:
CREATE TABLE Party_Library
(
Party INT(11),
Library varchar(40),
PRIMARY KEY (Library,Party),
FOREIGN KEY (Party) REFERENCES Party(PartyKey) ON DELETE CASCADE,
FOREIGN KEY (Library) REFERENCES MusicLibraries(MusicSource) ON DELETE CASCADE
);
我试图理解为什么使用以下代码会发生解析错误 (1064)。
<#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 '' at line 3>
CREATE TABLE Party_Library
(
Party INT(11)
Library varchar(40)
PRIMARY KEY (Library,Party)
FOREIGN KEY (Party) REFERENCES Party(PartyKey) ON DELETE CASCADE
FOREIGN KEY (Library) REFERENCES MusicLibraries(MusicSource) ON DELETE CASCADE
)
每个声明后都缺少逗号:
CREATE TABLE Party_Library
(
Party INT(11),
Library varchar(40),
PRIMARY KEY (Library,Party),
FOREIGN KEY (Party) REFERENCES Party(PartyKey) ON DELETE CASCADE,
FOREIGN KEY (Library) REFERENCES MusicLibraries(MusicSource) ON DELETE CASCADE
);