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 a nested table and how is it different from a normal table?

1006


How to get a create statement for an existing table?

927


What is a cursor and what are the steps need to be taken?

1150


How to get execution path reports on query statements?

947


Provide an example of a shell script which logs into SQLPLUS as SYS, determines the current date, changes the date format to include minutes & seconds, issues a drop table command, displays the date again, and finally exits.

2071


For a field in a repeating frame, can the source come from the column which does not exist in the data group which forms the base for the frame ?

1988


Why do we use coalesce function in oracle?

1074


How to drop a tablespace?

1012


Is oracle a language?

914


Can multiple columns be used in group by in oracle?

949


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

1984


Give the advantages and disadvantages of clusters.

1017


How to create a new table by selecting rows from another table?

1047


How to create a new tablespace in oracle?

950


How do I find the database name in oracle?

1002