Is there a simple elegant method to return the difference between two unordered, delimited strings in Oracle using PL/SQL?
Example:
String A: "a1, b4, g3, h6, t8, a0"
String B: "b4, h6, a0, t8, a1"
Difference: “g3”
I don’t have access to APEX_UTIL as suggested in this answer Difference between two unordered deliminted lists (Oracle)
I usually prefer using the MULTISET operator for situations like this.
The solution below is not exactly elegant though as you have to tokenize the string to use the MULTISET operator but if you get the lists as collections then this would be very easy (or if you have a common tokenizer already). (The tokenizer below is not very fast.)