Re: need help with Oracle (for a query)

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: 5 May 2003 07:13:43 -0700
Message-ID: <a20d28ee.0305050613.698a5fc2_at_posting.google.com>


"Limner" <ATTENZIONEpend77_at_yahoo.itATTENZIONE> wrote in message news:<ZXqta.91802$iy5.2854423_at_twister2.libero.it>...
> Hi to all
>
> i've a question.
> I need to know how to count how many times it present a particular caracter
> in a varchar2 field ( i've oracle 9i )
>
> For example: " Pippo|pluto|paperino" and i want to know how many times
> is present the caracter "|" ( 2 times )
>
> can someone help me in this ??
>
> Thanks in advance
>
> Danilo

select length(translate('abc.de.f','.abcdef','x')) from dual does the trick for periods: you translate the . by a character you don't use and all other characters translate to the NULL string.

Hth

Sybrand Bakker
Senior Oracle DBA Received on Mon May 05 2003 - 16:13:43 CEST

Original text of this message