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
How to initialize variables with default values?
What is meant by an index?
Explain how are indexes update?
How to load a large xml file?
How to create a table interactively?
What is a user role in oracle?
How to create lov dynamically at runtime & attach to text field?
What is the recommended interval at which to run statspack snapshots, and why?
We are using Oracle apps with XML publisher.In that,we are facing some problems while giving a Footer in RTF Template.While giving a footer in RTF Template it is Visible in all the pages,but after the PDF is getiing generated,the Footer are Visible on alternate pages only (like on first page ,third page) and so on. Please provide the Solution for getting the Footer on all the pages.
What is clustered table in Oracle?
What do you mean by cdb and pdb in oracle 12c?
Why does for update in oracle 8 cause an ora-01002 error?
What is the parameter mode that can be passed to a procedure?
What are the execution control statements?
How to find out what oracle odbc drivers are installed?