Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Give SQL Query to find the number words in a sentence ?
ex: 'ram charan singh' then ans:3
Answer:select length(trim('ram charan singh')) - length
(replace
(trim ( 'ram charan singh'),' ','')) +1 from dual

The above query working properly when space between the
words is only one &similar
But ,If the space between the words is nonuniform.
Ex:'ram charan singh is good' ans:5
i am not getting this answer using above query.

Answer Posted / murali mohan

Try This in 10g

SELECT length(REGEXP_REPLACE('ram charan
singh is good',
'( ){2,}', ' ')) - length(replace (trim ( 'ram
charan singh is good'),' ','')) +1
AS RX_REPLACE
FROM dual;

Regards,
Murali

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of oracle?

1068


What is define in oracle?

1110


What is the difference between hot backup and cold backup in oracle?

1076


How to use group functions in the select clause using oracle?

1132


How to list all user accounts in oracle?

1065


What is a snapshot in oracle database?

1071


Hi Masters, in Oracle Applications 11i, we hace 2 functions using the same form, i need to create 1 personalization, but that code must afect only one function.... how can i do that?

2269


How do I find my oracle client driver version?

1092


What is a nested table and how is it different from a normal table?

1106


How to execute a stored program unit?

1128


Illustrate how to determine the amount of physical CPUs a Unix Box possesses (LINUX and/or Solaris).

2365


Explain about achiever in sql?

1086


How can I create database in oracle?

1066


Is postgres faster than oracle?

1082


defination of bitmap index

2177