# 使用char_length和replace函数来计数 select id, char_length(string) - char_length(replace(string,',','')) cnt from strings;