您好,感谢您阅读我的问题!我收到此代码的语法错误,但我无法弄清楚出了什么问题。任何见解都非常感谢。
mysql> create table match (
-> event_id int not null,
-> player1_id int,
-> player2_id int,
-> player1_score int,
-> player2_score int,
-> winner_id int,
-> foreign key (event_id) references event(id)
-> );
ERROR 1064 (42000): 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 'match (
event_id int not null,
player1_id int,
player2_id int,
player1_score int' at line 1
我找不到任何丢失的逗号,并且事件表肯定存在一个 id 列。任何想法我缺少什么?谢谢!
匹配是一个保留字。用反引号括起来:
create table `match` ...
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句