Fortega
Fortega

Reputation: 19702

Mysql compare Strings

from a resultset of about 5 different strings, I would like to select the result of which the string resembles my given string the most. Is there any possibility to do this in mysql?

Upvotes: 3

Views: 1371

Answers (2)

Frank Shearar
Frank Shearar

Reputation: 17142

This sounds like the perfect application of the Levenshtein distance metric.

It appears that there is at least one UDF implementation of this metric, which may have fallen off the web, and another SQL implementation.

Upvotes: 1

David Hedlund
David Hedlund

Reputation: 129832

You might be able to achieve this using SOUNDEX

Upvotes: 2

Related Questions