if a string is there like s1,s2,s3,s4.How to find count of
commas in this.
Answers were Sorted based on User's Feedback
Answer / ajit
select 's1,s2,s3,s4' str,
length('s1,s2,s3,s4') - length(replace('s1,s2,s3,s4', ',')) str2
from dual;
Is This Answer Correct ? | 11 Yes | 1 No |
Answer / prashant
14:41:23 SQL> SELECT regexp_count ('s1,s2,s3,s4', ',')
14:41:24 2 FROM DUAL;
REGEXP_COUNT('S1,S2,S3,S4',',')
-------------------------------
3
Elapsed: 00:00:00.00
14:41:26 SQL>
Is This Answer Correct ? | 9 Yes | 2 No |
Answer / debbie
select
length('s1,s2,s3,s4')-length(replace('s1,s2,s3,s4',',')) as
Count_comma from dual
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / ashok
SELECT LENGTH(REGEXP_REPLACE('s1,s2,s3,s4', '[s0-9]', '')) FROM dual
Is This Answer Correct ? | 1 Yes | 0 No |
What is left join example?
How can we connect an Android App to an Oracle database and use the PL/SQL procedural code?
What is faster join or subquery?
What is procedure and function?
how to get the third quarter of employee details from emp?
If you want a column to be part of the result set, after which SQL keyword does it belong? 1. SELECT 2. FROM 3. WHERE 4. GROUP BY 5. HAVING
10 Answers HCL, TCS,
What does data normalization mean?
what are wild cards used in database for pattern matching ? : Sql dba
What are the different sql languages?
What is nested table in pl sql?
What are the different operators available in sql?
What happens if a procedure that updates a column of table X is called in a database trigger of the same table ?