2012-01-01 171 views
1

我在其中有两个关键词google plus我。怎么可以从我的数据库中搜索时,我有确切的一个词像googleplus或两者google plus,而不是gooplu列。MySQL关键字搜索?

我试图用LIKE函数来达到我的需要,但没有帮助。

感谢

+0

http://dev.mysql.com/doc/refman/5.1/en/regexp.html – ethrbunny 2012-01-01 22:24:09

回答

0

这不是一个关系数据库或者是一个很好的使用。你需要像Lucene这样的可以索引值并允许你进行搜索的东西。

1

试试这个:

SELECT keyword FROM tablename WHERE keyword LIKE '%google%' OR keyword LIKE '%plus%' 
0
col LIKE '%google%' OR col LIKE '%plus%' OR col LIKE '%google plus%'