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

How many types of triggers are there in pl sql?

0 Answers  


How do you delete a table?

0 Answers  


what is the command line end user interface - mysql? : Sql dba

0 Answers  


HOW TO APPEAR FOR ONLINE EXAMS OF SQL & PL/SQL? WHICH BOOKS WILL BE BETTER FOR REFERENCE TO QUALIFY THESE EXAMS? ARE THERE ANY MODEL PAPERS AVAILABLE IN THE MARKET ABOUT SQL & PLSQL?

2 Answers  


What is coalesce sql?

0 Answers  






What are the different types of a subquery?

0 Answers  


Is foreign key mandatory?

0 Answers  


What is sql lookup?

0 Answers  


What is a pl/sql block?

0 Answers  


How to delete same emp id in sql query for exmaple in emp table emp id, empname, emp address. for example emp id =5, repeated in two times in rows same id how to delete same empid please any one of the write query send in my id

8 Answers   CGCI,


What is pragma in sql?

0 Answers  


What do you understand by pl/sql cursors?

0 Answers  


Categories