How can I count number of occurrences of the character -
in a varchar2 string?
Example:
select XXX('123-345-566', '-') from dual;
----------------------------------------
2
How can I count number of occurrences of the character -
in a varchar2 string?
Example:
select XXX('123-345-566', '-') from dual;
----------------------------------------
2
I justed faced very similar problem... BUT RegExp_Count couldn't resolved it. How many times string '16,124,3,3,1,0,' contains ',3,'? As we see 2 times, but RegExp_Count returns just 1. Same thing is with ''bbaaaacc' and when looking in it 'aa' - should be 3 times and RegExp_Count returns just 2.
I lost some time to research solution on web. Couldn't' find... so i wrote my own function that returns TRUE number of occurance. Hope it will be usefull.