表sys_dept中有个字段 ancestors,ancestors的值是含有“,”(逗号) 现在需要计算“,”(逗号)这个字符串在ancestors中出现的数量
SELECT dept_id, dept_name, ancestors, round(( CHAR_LENGTH(ancestors) - CHAR_LENGTH(REPLACE(ancestors, ',', ''