开发者

string matching function in mysql

I've to match a string with strings in a co开发者_JAVA百科lumn of mysql table, i need to select the strings which has more than 80% of match. is there any function in mysql will do this?

for example "quote by placing" string matches more than 80% for the string"quote by place". Like this i've filter.

Thanks!


A FULLTEXT search would probably be the best approach for what you're doing. No need to pick an arbitrary % otherwise.

If you're doing more intensive searching check out some of the engines like Sphinx


try chopping 20% of a string in php and then use like for 80% of your string and all strings to compare


You could try looking at the MYSQL soundex function that may give you what you need


As far as I understand your criteria, you want a fuzzy search. This is not implemented in MySQL. You will have to find a way to externalize the check for this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜