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

How to add another datafile to a tablespace?

1047


What are ddl statements in oracle?

1081


How would you go about verifying the network name that the local_listener is currently using?

2053


What is a cursor in oracle?

1186


How to delete a user account in oracle?

983


what is the use of triggers in Java program? I mean where do we use triggers in Java programming?

2190


What is the usage of analyze command in oracle?

1100


interview questions with answer for cts

2593


What is a read write transaction in oracle?

1096


Is insert autocommit in oracle?

1079


Differentiate between pre-select and pre-query?

1115


What do you understand by database schema and what does it hold?

1237


Please explain oracle left join with an example?

1054


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

2330


What is logical backup in oracle?

1025