Hi Mike,
I was planning to do something like David suggested: I would sort the rows
based on name and then I would use a window (i.e. 100 rows) to compare each
individual name to the previous 100. All I want to do is create groups of
similar rows based on some criteria.
--
View this message i
Thanks for the help. I will give your code a try. Btw I know how to solve
this in a different language but unfortunately I am a very rookie with
databases.
--
View this message in context:
http://postgresql.nabble.com/Merge-rows-based-on-Levenshtein-distance-tp5828841p5829145.html
Sent from th
David,
Thanks for the useful feedback. Since I am not an experienced developer it
is too complicated for me to come up with the queries. Besides I wonder if
this is going to be efficient to do this processing on PostgreSQL.
--
View this message in context:
http://postgresql.nabble.com/Merge-ro
David,
Thank you for your prompt reply. I believe your answer helped a lot but it
seems I was not clear enough on my description. Basically I want a counter
(id) to show if two or more names are similar (i.e. levenshtein distance
less than 3) So in the previous example:
>From this table:
Name,
I am new to PostgreSQL and I have the following table:
Name, City
"Alex", "Washington"
"Aleex1", "Washington"
"Bob", "NYC"
"Booob", "NYC"
I want to "merge" similar rows based on levenshtein distance between names
so that I have the following table:
id, Name, City
1,"Alex", "Washington"
1,"Aleex1