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



if a string is there like s1,s2,s3,s4.How to find count of commas in this...

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

if a string is there like s1,s2,s3,s4.How to find count of commas in this...

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

if a string is there like s1,s2,s3,s4.How to find count of commas in this...

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

if a string is there like s1,s2,s3,s4.How to find count of commas in this...

Answer / ashok

SELECT LENGTH(REGEXP_REPLACE('s1,s2,s3,s4', '[s0-9]', '')) FROM dual

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

What is a natural join?

0 Answers  


what is auto increment? : Sql dba

0 Answers  


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)

1 Answers  


What are the different dcl commands in sql?

0 Answers  


What is recursive stored procedure?

0 Answers  






What is an oracle stored procedure?

0 Answers  


How do you create an update query?

0 Answers  


What are sql functions? Describe the different types of sql functions?

0 Answers  


what is the main difference between join and subqurey?

3 Answers   Oracle,


Mention what plvcmt and plvrb does in pl/sql?

0 Answers  


How does one load ebcdic data? : aql loader

0 Answers  


What is a sql driver?

0 Answers  


Categories