sort characters within a varchar2
drlarsenSep 11 2008 — edited Sep 15 2008Hello,
I have two tables of data which I'd like to align. Both tables have the names of locations. The format of the names in the two tables is similiar, but slightly different.
eg.
Table1: The Museum of Life
Table2: Life, The Museum of
My idea was to sort all the characters in the two string (while dropping anything not alphanumeric and ignoring case) in order to align the two.
eg.
The Museum of Life -> EEEFFILMMOSUU
Life, The Museum of -> EEEFFILMMOSUU
Only I can't figure out a way to do that in Oracle. I imagine it would be possible to write a PL/SQL script, but before I get into that I thought I'd see if there's a built-in way to do what I'm trying to do, or perhaps someone else already has a better idea to do what I'm trying to accomplish?
Thanks for any help and advice.