-- length + replace
select id,
length(string)-length(replace(string, ',', '')) as cnt
from strings