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 are the three pl sql block types?
How can we connect an Android App to an Oracle database and use the PL/SQL procedural code?
What are the different types of dbms?
What is an intersect?
What does pragma mean?
Is sql an operating system?
what is try_catch block in procedure
How do you truncate?
What is the difference between distinct and unique in sql?
What are conditional predicates?
how can create data base link for tow servers (scott schema) give examples plz
Can a procedure in a package be overloaded?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)