簡體   English   中英

MySQL語法錯誤,無法找出問題所在

[英]MySQL syntax error, can't figure out what's wrong

您好,感謝您閱讀我的問題! 我收到此代碼的語法錯誤,但無法弄清楚出了什么問題。 非常感謝任何見解。

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` ...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM