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 is user managed backup in Oracle?

1120


What is a table index?

1071


what is the dual table in oracle?

971


what happened to the global index when I truncate the data in one of the partition?

2009


What is a dynamic performance view in oracle?

977


How would you best determine why your MVIEW couldnt FAST REFRESH?

1882


How to find out what oracle odbc drivers are installed?

1024


List out the difference between commit, rollback, and savepoint?

1018


How to start your 10g xe server from command line?

1055


How to insert a new row into a table in oracle?

1138


WHAT IS ecc 6.0

2139


What language does oracle use?

1083


Explain the use of grant option in exp command.

1038


what is port in oracle? how is it related to database application.

1925


What is an oracle and why it is used?

1128