题解 | #查找字符串中逗号出现的次数#
查找字符串中逗号出现的次数
http://www.nowcoder.com/practice/e3870bd5d6744109a902db43c105bd50
select id,length(string)-length(replace(string,",","")) cnt from strings;
之前一直不知道length这个函数,也是看了解题区才写出来这题的,感觉还是有些迷迷糊糊的,对于 length(replace(string,",","")这部分并不是很理解