Re: SQL Select Query with String Manipulation

From: Alex Filonov <afilonov_at_yahoo.com>
Date: 25 Oct 2002 08:47:31 -0700
Message-ID: <336da121.0210250747.6a39247d_at_posting.google.com>


a7t2fz001_at_sneakemail.com (Andrew Cox) wrote in message news:<c40fc812.0210241337.76edb331_at_posting.google.com>...
> Hi,
>
> I'm trying to do a little string manipulatin within a SQL Select
> statement and I'm not sure if it's possible or not. Here's the type
> of data that I have in the field I'm concerned with:
>
> DESCR:
> ------
> 02 A code with description
> 24 Some description here
> 42 Another Description here
> A description without a corresponding code
> Another description without a code
>
> Okay ... what I want to do is strip the number codes from the
> descriptions that have them *within* the SQL Select query. I need to
> do it within the query because of other constraints (I have to pass
> the whole query to a ColdFusion custom tag). The problem as I see it
> is that not all of the fields will have the leading code (though most
> of them do).
>
> Is it possible to do that kind of string manipulation within the
> SELECT statement?

Here's the example:

  1 select
  2 ltrim('02 Message 01', '012345679 ')   3* from dual
SQL> / LTRIM('02M



Message 01

>
> Thanks for your help!
Received on Fri Oct 25 2002 - 17:47:31 CEST

Original text of this message