Home » SQL & PL/SQL » SQL & PL/SQL » How many 't' we have in "i want to get more"
How many 't' we have in "i want to get more" [message #204639] Tue, 21 November 2006 08:29 Go to next message
kanmani_karuppannan
Messages: 23
Registered: November 2006
Location: India
Junior Member

Hi,

I have a string like : "i want to get more"

In this string i want to count how many t we are having.

Please advice me.

Thanks in advance.

Regards,
Mani.
Re: How many 't' we have in "i want to get more" [message #204641 is a reply to message #204639] Tue, 21 November 2006 08:31 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
select length(string) - length(replace(string,'t',''))
from dual;


I suspect that @ebrian will be along soon with a cooler, 10g only RegEx solution.

Re: How many 't' we have in "i want to get more" [message #204645 is a reply to message #204641] Tue, 21 November 2006 08:41 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
JRowbottom wrote on Tue, 21 November 2006 15:31
I suspect that @ebrian will be along soon with a cooler, 10g only RegEx solution.
Can I try? Very Happy
select length(regexp_replace('&t','[^t]','')) x
from dual
/


MHE
Re: How many 't' we have in "i want to get more" [message #204715 is a reply to message #204641] Tue, 21 November 2006 18:30 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Thanks JRowbottom, looks like Maaher beat me to it.

Nice Maaher !
Re: How many 't' we have in "i want to get more" [message #204799 is a reply to message #204715] Wed, 22 November 2006 02:43 Go to previous message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
ebrian wrote on Wed, 22 November 2006 01:30
Thanks JRowbottom, looks like Maaher beat me to it.

Nice Maaher !

You've cleared the path! I'm getting into it.

MHE
Previous Topic: combine the OR
Next Topic: Aggregate Function
Goto Forum:
  


Current Time: Wed Dec 07 03:18:49 CST 2016

Total time taken to generate the page: 0.11447 seconds