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 / devraj
Select Length('ram charan singh') - length(replace('ram
charan singh', ' ','')) from dual;
Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Is java required for oracle client?
How to update values on multiple rows in oracle?
What is java oracle used for?
Explain compound trigger in oracle?
How to divide query output into groups in oracle?
What operating systems are supported by oracle database 10g xe?
Explain the use of control file?
How to start a new transaction in oracle?
What are the uses of synonyms?
how to join query for one source type is oracle another source type is sql server ?
What is a user account in oracle?
What are nested tables?
Can I create users through internet explorer in oracle 10g?
How to use "startup" command to start default instance?
What are the differences between char and nchar in oracle?