R
R
Roman Mirilaczvili2016-11-13 20:35:34
MySQL
Roman Mirilaczvili, 2016-11-13 20:35:34

How to find duplicate last names using Levenshtein distance?

How to find duplicates in the Clients table with last_name surnames, having a custom Levenstein function?
The distance should not exceed 2. It turns out that you need to compare each surname with the rest. I can't figure out how it's done in SQL.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Pozharsky, 2016-11-13
@2ord

select client.last_name
from clients client
inner join clients other_client on levenshtein(client.last_name, other_client.last_name)<=2;

Not?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question