I have a table Units and this contain a UnitCode column. This column contains value like for ex: abbbccde
What I would like is to count the how many times character 'b' and 'c' in this value is found this value as:
UnitCode Character Count
--------------------------------
abbbccde b 3
abbbccde c 2
What I tried so far was is (Thanks to @Arul):
SELECT REGEXP_COUNT('abbbccde', 'b') AS Result FROM dual;
SELECT REGEXP_COUNT('abbbccde', 'c') AS Result FROM dual;
This gives the correct count. How can get it like the way I want?