Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: I want to know how many times comma(,) appear in string ...

Re: I want to know how many times comma(,) appear in string ...

From: Tommy Hagström <tomhag_at_rsv.se>
Date: Tue, 28 Sep 1999 16:34:36 +0200
Message-ID: <Pine.HPX.4.05.9909281614470.19881-100000@u30040.rsv.rsv.se>


On Mon, 27 Sep 1999, ÃÖ»ó¼ø wrote:

> I want to know the count of the string or character
>
> as follows .
>
> Given,
> ls_string = '1253,5678,ascd,!@#er, 5896, @@@;';
>
>
> How many times appear comma(,) in the string 'ls_string' ?
>
> The result : The comma(,) appears five times in the 'ls_string' .
>
> Is there any function or other way to resolve this problem ?
>
> We use Oracle 7.3.3.3.
>
> Thanks in Advance .
>

Just try this:

    select length(ls_string) - length(replace(ls_string,',')) from ???

tomhag_at_rsv.se Received on Tue Sep 28 1999 - 09:34:36 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US