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!

Substracting two strings in a query

user9098259Mar 18 2019 — edited Mar 18 2019

Hello, i'd like to do the following in Oracle 10g:

I am trying to clean some data in a client address table which in some cases contains repeated patterns to the right side of the string, for example:

"anything 11241 address xyz 154 address xyz 154"

After cleaning this the result should be: "anything 11241 address xyz 154"

At least i have access to the repeated pattern (always at the right side of the string), so what i have to do is to try to subtract one string from the other like a RTRIM, but only one match:

select 'anything 11241 address xyz 154 address xyz 154'  --> column A

          , 'address xyz 154'     --> column B

          , ??--> column C should be column A - column B, in this case: anything 11241 address xyz 154

from dual;

Thanks in advanced.

Mensaje editado por: user9098259

This post has been answered by Cookiemonster76 on Mar 18 2019
Jump to Answer
Comments
Post Details
Added on Mar 18 2019
8 comments
672 views