gpt4 book ai didi

php - 如何使用 MySQL 全文搜索短语而不是使用 LIKE

转载 作者:行者123 更新时间:2023-11-29 02:07:13 25 4
gpt4 key购买 nike

如何使用 mysql 全文搜索来搜索短语而不是 like :

SELECT description FROM t WHERE info LIKE "%Search phrase one%" OR  info LIKE "%Phrase second%"  OR info LIKE "%Another phrase with more words%"

最佳答案

这是一个搜索短语的示例查询:

SELECT * FROM table WHERE MATCH ( col1,col2,col3 ) 
AGAINST ('"some words" "another phrase"' IN BOOLEAN MODE);

更多信息:http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html

关于php - 如何使用 MySQL 全文搜索短语而不是使用 LIKE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3908697/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com