gpt4 book ai didi

database - 如何从搜索查询中搜索子项?

转载 作者:塔克拉玛干 更新时间:2023-11-03 06:39:40 26 4
gpt4 key购买 nike

假设我有一个搜索查询'the black top hat the red shirt the blue top hat'。项目 'the black top hat''the red shirt' 存在于数组中,但是,'the blue top hat' 不存在在数组中。如果项目存在于数组中,我将如何搜索,因为这些项目都组合到一个搜索字符串中并且不是分开的。

我是否必须搜索 'the'、'the black'、'the black top'、...、'black'、'black top' 等... 还是有更好的解决方案吗?

最佳答案

像这样尝试:

select ...
from ...
where mycol like '%the black top hat%'
and mycol like '%the red shirt%'
—- etc

过滤掉具有特定值的行:

and mycol not like '%the blue top hat%'

关于database - 如何从搜索查询中搜索子项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52980256/

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