sql Match()反对无法识别(sql Match () Against unrecognized)

编程入门 行业动态 更新时间:2024-10-25 05:25:27
sql Match()反对无法识别(sql Match () Against unrecognized)

当我尝试这个查询

SELECT name, cost FROM items WHERE MATCH (name) AGAINST ('baby')

phpmyadmin给了我一个警告:

Unrecognized keyword. (near "MATCH" at position 43) Unexpected token. (near "(" at position 49) Unexpected token. (near "name" at position 50) Unexpected token. (near ")" at position 58) Unrecognized keyword. (near "AGAINST" at position 60) Unexpected token. (near "(" at position 68) Unexpected token. (near "'baby'" at position 69) Unexpected token. (near ")" at position 74)

它仍然显示正确的结果。 当我尝试另一个查询:

SELECT fisrt_name , country FROM people WHERE MATCH (first_name) AGAINST ('marr')

它只给我和错误而没有得到结果。 我做错了吗?

编辑:我更新了phpmyadmin,但我得到的是新的错误消息说

Can't find FULLTEXT index matching the column list

When I tried this query

SELECT name, cost FROM items WHERE MATCH (name) AGAINST ('baby')

phpmyadmin gives me a warning that states:

Unrecognized keyword. (near "MATCH" at position 43) Unexpected token. (near "(" at position 49) Unexpected token. (near "name" at position 50) Unexpected token. (near ")" at position 58) Unrecognized keyword. (near "AGAINST" at position 60) Unexpected token. (near "(" at position 68) Unexpected token. (near "'baby'" at position 69) Unexpected token. (near ")" at position 74)

and it still shows the correct result. When I tried another query:

SELECT fisrt_name , country FROM people WHERE MATCH (first_name) AGAINST ('marr')

It only gives me and error without getting result. Is there any mistakes that I did?

EDIT: I updated the phpmyadmin but what I got is new error message saying

Can't find FULLTEXT index matching the column list

最满意答案

ALTER TABLE people ADD FULLTEXT people_first_name(first_name);

尝试此操作在列first_name上添加全文索引,然后重试查询。

ALTER TABLE people ADD FULLTEXT people_first_name(first_name);

Try this to add a full text index on column first_name, and retry your query.

更多推荐

本文发布于:2023-07-25 22:34:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1267176.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:无法识别   sql   Match   unrecognized

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!