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 are the varoius components of physical database structure of oracle database?

983


Can you drop an index associated with a unique or primary key constraint?

1000


What are triggers in oracle?

1009


What is a subquery?

1102


Can a parameter be passed to a cursor?

1102


How to define a data field as not null?

1092


what are the advantages of running a database in archive log mode?

2186


What is memory advisor in Oracle?

1059


How many types of tables supported by oracle?

1058


What is the best way to do multi-row insert in oracle?

1049


How to join two tables in a single query using oracle?

970


How to bring a tablespace offline?

1046


How do I uninstall oracle 11g?

1095


Explain oracle 12c new features for developers?

1024


Why do we use coalesce function in oracle?

1096