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 / murali mohan
Try This in 10g
SELECT length(REGEXP_REPLACE('ram charan
singh is good',
'( ){2,}', ' ')) - length(replace (trim ( 'ram
charan singh is good'),' ','')) +1
AS RX_REPLACE
FROM dual;
Regards,
Murali
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are the oracle built-in data types?
How can I get column names from a table in oracle?
Please send me Informatica 8.1 certification dumps, my mail id mona85gupta@gmail.com
Give syntax for SQL and ORACLE joins.
What do you mean by a database transaction & what all tcl statements are available in oracle?
What is a parameter file in oracle?
What are the extensions used by oracle reports?
What is enter substitution variable in oracle?
What is an oracle cursor variable?
What is index-organized table in Oracle?
HI Friends Myself Manoj,i am from bengaluru.i have 1 yr of exp in PLSQL but not upto the mark..now attending interviews but m not able to clear even 1 round..i have attended 3 interviews till today.purpose of writing this query is,i want to know the intreview topics that interviewer going to ask frequently,mainly SCENARIO based questions.IF anybody have any PLSQL projects please give it to me,it will helps me alot.Thanks for your patience.
What are the parameters that we can pass through a stored procedure?
What is merge in oracle?
What is an index associated with a constraint?
State and explain about oracle instance?