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!

sort characters within a varchar2

drlarsenSep 11 2008 — edited Sep 15 2008
Hello,

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.
This post has been answered by Solomon Yakobson on Sep 12 2008
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 13 2008
Added on Sep 11 2008
10 comments
616 views