Created
May 9, 2019 22:55
-
-
Save abevieiramota/5425f50f1746d83310cb469358454d2a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE EXTENSION fuzzystrmatch; | |
create table nomes(nome) as | |
(values | |
('abelardo'), | |
('aberlado'), | |
('aberlardo'), | |
('jurandir'), | |
('jurandr'), | |
('abraão') | |
); | |
select levenshtein(n1.nome, n2.nome), array_agg(array[n1.nome, n2.nome]) | |
from nomes n1, nomes n2 | |
where n1.nome <> n2.nome and n1.nome > n2.nome | |
group by 1 | |
order by 1 asc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment