开发者

ERROR 1064 (42000) : You have an error in your SQL syntax

I'm running the following SQL:

create table group(groupID varchar(15) primary key,
group_name varchar(30),
name_of_member varchar(100),
studentID varchar(15),
foreign key(studentID) references student(studentID))engine=innodb;

Bu开发者_Go百科t it's not working. I'm getting the error:

ERROR 1064 (42000) : You have an error in your SQL syntax.... near group(groupID varchar(15) primary key, group_name varchar(30),name_of_member va' at line 1

PLEASE HELP ME... :(


group is a keyword [think select sum(column) from sometable group by name]. You'll need to name your table something different.

Some DBMSes will let you use keywords as table/column names, but they need to be escaped. i.e. in MSSQL, you'd use create table [group](...).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜