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 / aseem k

a is only column for table e

select a,length(regexp_replace(regexp_replace(a, '[^ ]
{1,}','1') ,'( +){1,}',''))
from e
/

it took me exactly 90 min's

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is hash cluster in oracle?

1244


What do you mean by a deadlock?

1107


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

1123


How a tablespace is related to data files?

1162


Is truncate autocommit in oracle?

1147


Please explain drop constraint oracle?

1155


How to use windows user to connect to the server?

1043


How can we delete duplicate rows in a table?

1036


What is the use of file param in imp command?

1215


How to open a cursor variable?

1087


Can we save images in a database and if yes, how?

1108


What is oracle update statement with inner join ?

1114


Is it possible to insert comments into sql statements return in the data model editor ?

2636


In what script is snap$ created? In what script is the scott/tiger schema created?

2759


Please explain joins in oracle?

1104