Find number of vowels in the given string in Oracle

By Santhosh N

This explains how to find the number of vowels in the given string in Oracle.

In oracle, we can find the number of occurrences of char(s) using two built in functions namely LENGTH and TRANSLATE functions.


Here is a query to find the number of vowels present in the given string (str in the below query)


SELECT LENGTH(str)-LENGTH(TRANSLATE(str,'xaeiou','x')) FROM DUAL;

Related FAQs

This explains how to find the length of the string in oracle
Find number of vowels in the given string in Oracle  (2404 Views)