Re: [GENERAL] Merge rows based on Levenshtein distance

2014-12-03 Thread mongoose
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

Re: [GENERAL] Merge rows based on Levenshtein distance

2014-12-03 Thread mongoose
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

Re: [GENERAL] Merge rows based on Levenshtein distance

2014-12-03 Thread mongoose
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

Re: [GENERAL] Merge rows based on Levenshtein distance

2014-12-02 Thread mongoose
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,

[GENERAL] Merge rows based on Levenshtein distance

2014-12-01 Thread mongoose
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