gpt4 book ai didi

mysql - 想要从数据库中搜索,忽略内容中的空格

转载 作者:行者123 更新时间:2023-11-29 19:16:12 25 4
gpt4 key购买 nike

我想从数据库中搜索一个“无意识的 self ”键。在数据库中,内容以这种形式存在::

它。麻线本身处于幻觉中,因为它发现自己被结绑住了。

结是业相,麻线是灵魂。因为灵魂是无意识的

它自己作为上帝,它的注意力仍然集中在结上。被释放

我使用以下 SQL 查询来获取结果:

SELECT f.content FROM file_details f WHERE REPLACE(f.content, ' ', '') = REPLACE("unconscious of its own Self", ' ', '');

没有找到这样的记录。原因是,sql 函数 REPLACE(f.content, ' ', '') 将我的内容转换为以下格式::

"it.Thetwineitselfisinillusionbecauseitfindsitselfboundbyknots.
Theknotsarethesanskarasandthetwineisthesoul.Becausethesoulisunconscious
ofitsownSelfasGod,itsattentionremainsfocussedontheknots.Tobefreed"

如果您在上面的内容中替换“unknownofitsownSelf”后看到我的搜索键,您会发现它位于两个单独的行中。这就是为什么我的结果为 0。

您能否为我提供一个解决方案来搜索我的 key ,该 key 甚至存在于单独的行中。

最佳答案

搜索您的数据库中是否存在“无意识的 self ”这个词:

set @sam = "it. The twine itself is in illusion because it finds itself bound by knots.
The knots are the sanskaras and the twine is the soul. Because the soul is unconscious
of its own Self as God, its attention remains focussed on the knots. To be freed";


select case when rplace like '%52521325241%' then 'found' else 'not found' end) from
(SELECT SOUNDEX(@sam) rplace) as a

或者这是第二个选项:

select case when rplace like concat('%',searchChar,'%') then 'found' else 'not found' end,searchChar from
(select SUBSTRING(SOUNDEX('unconscious of its own Self'),2) as searchChar,rplace from
(SELECT SOUNDEX(@sam) rplace) as a) as b;

关于mysql - 想要从数据库中搜索,忽略内容中的空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42688081/

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