If I have a string in a column on a row in a table like this 1 2 2 2 2 2 2 How would I count the occurrence of a substring 2 inside the string. Assume nothing other than a space-delimiter of " ". For the purposes of this, let's treat the numbers as substrings Sample data CREATE TABLE foo ...