How to find duplicate names by using the Levenshtein distance?

How having a user-defined function Levenstein find duplicates in a table Clients with the names of last_name?
Distance should not exceed 2. It turns out that you need to compare each name with the others. I can not understand how it is done in SQL.
July 2nd 19 at 17:05
1 answer
July 2nd 19 at 17:07
select client.last_name
from clients client
inner join clients on other_client levenshtein(client.last_name, other_client.last_name)<=2;

Where is the grouping for duplicates? Displays the entire list... - alfonso56 commented on July 2nd 19 at 17:10
Generally speaking - rather the type select - Everette56 commented on July 2nd 19 at 17:13

Find more questions by tags SQLProgrammingMySQL