Re: URGENT - REPLACE data problem (DECODE)

From: Andy Triggs <andrew.triggs_at_businessobjects.com>
Date: 9 Jul 2002 01:50:42 -0700
Message-ID: <2b6e86d0.0207090050.37e41aec_at_posting.google.com>


Assuming, as per your example, that all of the digits are on the right hand side of the text, you could use TRANSLATE to convert them to spaces and then RTRIM to remove them:

SELECT rtrim(translate(<data>, '0123456789', ' '), ' ') FROM <table_name>;

Hope this helps.

Regards, Andy

"AR" <AR69RA_at_gmx.net> wrote in message news:<rxmW8.276$QA.7860_at_news.siol.net>...
> Hello all!
>
> how can i "clean" data in Sqlplus in next case:
>
> i have something like
> Bill Gates123456
> Pamela Anderson532544
> Britney Spears42323
>
> i want to have
> Bill Gates
> Pamela Anderson
> Britney Spears
>
> so i want to get rid of all numbers
>
> i try to make something with decode, but i can't handle it, please help
Received on Tue Jul 09 2002 - 10:50:42 CEST

Original text of this message