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
Which is better Oracle or MS SQL? Why?
Explain the use of parfile option in exp command.
How to update a table row with a record?
How can we create the complete backup of data in the oracle.
How to see free space of each tablespace?
what is dynamic SGA and static SGA
What do you mean by a database transaction & what all tcl statements are available in oracle?
What is archive log in Oracle?
What is raw datatype in oracle?
How to import one table back from a dump file?
What are the different pseudo commands? Explain in general?
What is a view and how is it different from a table?
What is literal?
How to call a stored function with parameters?
what are bitmap indexes? How does they work?