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
What is the difference between translate and replace in oracle?
can u send the sql dumps to sivakumarr1987@gmail.com plz help me
Why do you create or replace procedures rather that drop and recreate.
How translate command is different from replace?
What is a partition in oracle?
Explain mutating triggers.
What is the database name in oracle?
Explain the different normalization forms?
What is a proxy object?
Can you tell me how to add new column in existing views?how?How is possible?
What is truncate oracle?
Explain about the analyze command in oracle?
How do we create privileges in oracle?
Is a rollback possible to any savepoint?
What is catalog in Oracle?