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.

Answers were Sorted based on User's Feedback



Give SQL Query to find the number words in a sentence ? ex: 'ram charan singh' then ans:3..

Answer / 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

Give SQL Query to find the number words in a sentence ? ex: 'ram charan singh' then ans:3..

Answer / devraj

Select Length('ram charan singh') - length(replace('ram
charan singh', ' ','')) from dual;

Is This Answer Correct ?    1 Yes 1 No

Give SQL Query to find the number words in a sentence ? ex: 'ram charan singh' then ans:3..

Answer / 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

More Oracle General Interview Questions

Can we store images in oracle database?

0 Answers  


What are the differences between date and timestamp in oracle?

0 Answers  


What is COST-based approach to optimization ?

5 Answers  


How to test null values?

0 Answers  


How to make a Data Backup in oracle ? What is the procedure for creating the dump files in oracle ( any version ) ?

3 Answers   Satyam,


How to open and close an explicit cursor in oracle?

0 Answers  


What is oracle in java?

0 Answers  


What is flashback in Oracle?

0 Answers   MCN Solutions,


How can we find out the duplicate values in an oracle table?

0 Answers  


"primary key=unique+null" is equal,reson?not,reason?

5 Answers  


What is Java Pool in Oracle?

0 Answers   MCN Solutions,


How to synchronize 2 schema's objects?

0 Answers   Virtusa,


Categories
  • Oracle General Interview Questions Oracle General (1809)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)