MySQL必知必会学习遇到的问题及解决方案

《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;

成功运行。

(也许还有其他解决方案,只是分享学习中遇到的错误以及我解决的办法,如果上述说法有错误,请批评指正,谢谢)

扫描二维码关注公众号,回复: 1545870 查看本文章

猜你喜欢

转载自blog.csdn.net/chenmoshashou2/article/details/80424494