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