我正在寻找用innodb引擎在mysql中搜索特定单词的方法。考虑以下示例:
Text:
1.Card has two sides.
2.This is my card.
3.We have a car.
4.Car has good color.
5.This was my car.
6.The car is nice.
假设这些点是不同的行并且位于同一列“文本”下。我需要一个查询,使用“like”提取恰好包含“car”一词的行,而不管“car”一词是在开头、中间还是结尾。请记住,“卡”不是必需的。
最佳答案
使用它
SELECT * FROM table WHERE name LIKE '%car' or name LIKE '%car %';
关于mysql - 在数据库中进行特定搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15542245/