mysql中查看一个字段中,有几个逗号

 利用replace、length的内置函数

SELECT id,  length(field) - length(replace(field,',',''))+1 as count   FROM `table` where 1
原文地址:https://www.cnblogs.com/firstForEver/p/4891815.html