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
what happened to the global index when I truncate the data in one of the partition?
What is the difference between post-database commit and post-form commit?
Can we insert data in view oracle?
What is flashback in Oracle?
How view is different from a table?
How to change program global area (pga) in oracle?
What are the arithmetic operations?
What is background process in Oracle?
How do we display rows from the table without duplicates?
How to create a server parameter file?
Explain oracle 12c new features for developers?
How to use select statement to count the number of rows in oracle?
what is normalisation?what are its uses?
What the is the diff between local index and global index. give some example.
Why do I get unexpected characters from 8-bit character sets in weblogic jdriver for oracle?