【发布时间】:2021-01-26 19:06:46
【问题描述】:
在 PHP 中,我有一个字符串 $str = 'word1 word2 word3'。
然后我有一个名为 content 的 mysql-db-field。
我需要哪个 MySQL 语句来获取在其content 中具有大部分 字的行 str?
例子:
- Row1 的字段:word1 word2 word1 word1 word2
- Row2 的字段:word9 word2 word1 word8 word2
- Row3 的字段:word1 word2 word1 word1 word3
将输出Row3,因为它包含word1、word2 和word3。
- Row1 的字段:word1 word2 word1 word1 word2
- Row2 的字段:word9 word2 word2 word8 word2
- Row3 的字段:word1 word1 word1 word1 word9
将输出Row1,因为它包含word1 和word2。
【问题讨论】:
-
您自己尝试过什么来解决这个问题? (我认为它不能在 1 个 MySQL 语句中完成)
-
全文索引?这是针对标签云之类的吗?
-
术语提示:它不是 MySQL“命令”,通常称为“语句”。
-
我看不出这个问题与 PHP 或 mysqli 有什么关系?你为什么这么坚持给它贴标签?
标签: mysql