Answer the question
In order to leave comments, you need to log in
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
select client.last_name
from clients client
inner join clients other_client on levenshtein(client.last_name, other_client.last_name)<=2;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question