Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

String comparison (words in a string) - suggestion needed

spanish_inquisitionNov 21 2014 — edited Nov 23 2014

Hello Experts;

I would like to ask you for suggestion in terms of string comparison in Oracle. Normally we have available two functions related to distance similarity: edit_distance_similarity and jaro_winkler_similarity but if we consider that words can have different order those methods (their algorithms) will provide to us unexpected results:

e.g. "ABCD GGGG" & "GGGG ABCD"

words are the same and the only difference is in their order but edit_distance_similarity will get us 12 and jaro_Winkler_similarity will get us 44 as a result what is small score assuming that 100 is exact match and  0 is mismatch. I've checked that and I couldn't find any standard method to handle this problem, so I assume that the only way is to create PL/SQL to divide string into several words separated by blanc spaces and then we can do comparison using standard methods word by words (at the end we can calculate final score as average score considering numer of rows that we have). Do you have any suggestions how to do that in more efficent way?

Regards,

Bolo

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 21 2014
Added on Nov 21 2014
6 comments
2,083 views