题目描述

查找字符串'10,A,B' 中逗号','出现的次数cnt。

 

SQL代码:

select length("10,A,B")-length(replace("10,A,b",",","")) as cnt

备注:

不得不说sql函数太强大了,replace为字符串替换函数