gpt4 book ai didi

mysql - 简化mysql全文搜索

转载 作者:行者123 更新时间:2023-11-30 23:40:37 25 4
gpt4 key购买 nike

现在要对 wordAwordBwordC 进行文本搜索,我是这样做的:

SELECT * FROM 
mytable
WHERE
MATCH (field1) AGAINST ('wordA' IN BOOLEAN MODE) OR
MATCH (field1) AGAINST ('wordB' IN BOOLEAN MODE) OR
MATCH (field1) AGAINST ('wordC' IN BOOLEAN MODE)

有没有更简洁的写法?

最佳答案

刚想出来这也行

SELECT * FROM 
mytable
WHERE
MATCH (field1) AGAINST ('wordA/wordB/wordC' IN BOOLEAN MODE)

关于mysql - 简化mysql全文搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3402550/

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