Re: Number of particular characters in a given string?

  • From: rjamya <rjamya@xxxxxxxxx>
  • To: dba.orcl@xxxxxxxxx
  • Date: Fri, 18 Feb 2005 16:20:34 -0500

what's wrong with

select length('CORPORATE FLOOR') - length(replace('CORPORATE FLOOR','O'))
from dual
/

which dutifully yields a value of 4 ??

Raj


On Fri, 18 Feb 2005 13:54:19 -0500, Sami Seerangan <dba.orcl@xxxxxxxxx> wrote:
> Is there any Oracle pre-defined fucntion to calculate number of given
> characters IN a given string?
> 
> For example, I want to know how many "O"s in string 'CORPORATE FLOOR'.
> 
> Thanks
> Sami
> --
> //www.freelists.org/webpage/oracle-l
> 


-- 
------------------------------
select standard_disclaimer from company_requirements where category =
'MANDATORY';
--
//www.freelists.org/webpage/oracle-l

Other related posts: