We can find no of characters in a string based on this query in two different ways:
=======================================================
select NVL(LENGTH(REGEXP_REPLACE(ENAME, '[^A]')),0) REG_COUNT,
length(ename) - length(replace(ename, 'A')) COUNT,
ENAME,
SAL,
JOB,
DEPTNO
FROM SCOTT.EMP;
=======================================================
select NVL(LENGTH(REGEXP_REPLACE(ENAME, '[^A]')),0) REG_COUNT,
length(ename) - length(replace(ename, 'A')) COUNT,
ENAME,
SAL,
JOB,
DEPTNO
FROM SCOTT.EMP;