gpt4 book ai didi

mysql全文搜索 "all but"查询

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

我需要在表中查询“all but keyword”。只使用“-”是行不通的,事实上 mysql manual说:

Note: The - operator acts only to exclude rows that are otherwise matched by other search terms. Thus, a boolean-mode search that contains only terms preceded by - returns an empty result. It does not return “all rows except those containing any of the excluded terms.”

我找到的唯一解决方法是“a* b* .... y* z* -keyword”,因为这允许匹配所有其他结果。还有其他(更清洁的)方法吗?

最佳答案

只需使用:

NOT MATCH(field) AGAINST(keyword)

关于mysql全文搜索 "all but"查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/363248/

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