开发者

string matching function in mysql

开发者 https://www.devze.com 2023-03-12 03:13 出处:网络
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?

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

精彩评论

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