《MySQL必知必會》
P123頁有這麼一個例子
select note_text, match(note_text)against('rabbit') as rank from productnotes;
在MySQL 8.0.11裏面會報錯
[Err] 1064 - You have an error in your SQLsyntax; check the manual that corresponds to your MySQL server version for theright syntax to use near 'rank
from productnotes' at line 1
主要原因是 rank 是MySQL裏面的關鍵字,把RANK修改爲rank1或其他名稱即可。
select note_text, match(note_text)against('rabbit') as rank1 from productnotes;
成功運行。
(也許還有其他解決方案,只是分享學習中遇到的錯誤以及我解決的辦法,如果上述說法有錯誤,請批評指正,謝謝)