String function
Using SQL to get the number of occurrences of a character in a string in SQL Server
This SQL Snippet can be used to get the count of a single character, or an entire phrase, in a string. We have a seperate post for doing the same thing in Oracle. Assume you have the string “a,b,c,d,e” and you want the count of commas (“,”) contained in that string. Just use the SQL below:…