Press "Enter" to skip to content

Find Number of Occurrences of a Character in a String in Oracle

Use Regexp_Count function in Oracle to count the number of occurrences of a string in Oracle using SQL. Below is the example to count the number of occurrences of Comma in a string.

Syntax: RegExp_Count(String, CharacterToFindOccurrences)

SELECT REGEXP_COUNT ('abc, skm, 23, a,,', ',') FROM DUAL

You will get the result 5.

number of occurrences of a character in a string in Oracle

Vinish Kapoor

I am a full stack developer and writing about development. I document everything I learn and help thousands of people. is created, written, and maintained by me, it is built on WordPress, and hosted by Bluehost. Connect with me on Facebook, Twitter, GitHub and get notifications for new posts.

You may also like:

Be First to Comment

    Leave a Reply

    Your email address will not be published. Required fields are marked *