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 a natural join?
what is auto increment? : Sql dba
Is there any problem if we use commit repeatedly after each dml statement in a plsq procedure ? (eg. there are 10 update stmt and using 10 commit stmt after each update stmt)
What are the different dcl commands in sql?
What is recursive stored procedure?
What is an oracle stored procedure?
How do you create an update query?
What are sql functions? Describe the different types of sql functions?
what is the main difference between join and subqurey?
Mention what plvcmt and plvrb does in pl/sql?
How does one load ebcdic data? : aql loader
What is a sql driver?