您好,感謝您閱讀我的問題!我收到這段代碼的語法錯誤,但我無法弄清楚什麼是錯的。任何見解都非常感謝。MySQL的語法錯誤,無法弄清楚什麼是錯
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列。任何想法我失蹤?謝謝!
匹配是一個保留字 - 表名不好選 – Strawberry